Fixed last issue with file being removed from the commit list when unstaging changes in a new file

This commit is contained in:
Jesse van den Kieboom 2009-02-21 12:48:21 +01:00
parent 80524bd4cc
commit c7451a1815
2 changed files with 6 additions and 2 deletions

View file

@ -1396,7 +1396,6 @@ on_unstage_changes(GtkAction *action, GitgCommitView *view)
return;
gitg_commit_unstage(view->priv->commit, file, NULL, NULL);
g_object_unref(file);
}
else
{

View file

@ -536,8 +536,13 @@ refresh_changes(GitgCommit *commit, GitgChangedFile *file)
update_index_staged(commit, file);
update_index_unstaged(commit, file);
GitgChangedFileChanges changes = gitg_changed_file_get_changes(file);
if (changes == GITG_CHANGED_FILE_CHANGES_NONE)
gitg_changed_file_set_status(file, GITG_CHANGED_FILE_STATUS_NEW);
if (gitg_changed_file_get_status(file) == GITG_CHANGED_FILE_STATUS_NEW &&
!(gitg_changed_file_get_changes(file) & GITG_CHANGED_FILE_CHANGES_CACHED))
!(changes & GITG_CHANGED_FILE_CHANGES_CACHED))
{
gitg_changed_file_set_changes(file, GITG_CHANGED_FILE_CHANGES_UNSTAGED);
}