[gitg] Fixed problem with reappearing file after reverting it



commit 760fd4285c9bec461209149055298112fc111b11
Author: Jesse van den Kieboom <jesse icecrew nl>
Date:   Thu Apr 23 23:09:24 2009 +0200

    Fixed problem with reappearing file after reverting it
---
 gitg/gitg-commit.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/gitg/gitg-commit.c b/gitg/gitg-commit.c
index c62a856..ea4cf5d 100644
--- a/gitg/gitg-commit.c
+++ b/gitg/gitg-commit.c
@@ -540,13 +540,14 @@ refresh_changes(GitgCommit *commit, GitgChangedFile *file)
 	update_index_unstaged(commit, file);
 	
 	GitgChangedFileChanges changes = gitg_changed_file_get_changes(file);
-	
-	if (changes == GITG_CHANGED_FILE_CHANGES_NONE)
+	GitgChangedFileStatus status = gitg_changed_file_get_status(file);
+
+	if (changes == GITG_CHANGED_FILE_CHANGES_NONE && status == GITG_CHANGED_FILE_CHANGES_NONE)
 		gitg_changed_file_set_status(file, GITG_CHANGED_FILE_STATUS_NEW);
 	else if ((changes & GITG_CHANGED_FILE_CHANGES_CACHED) && (changes & GITG_CHANGED_FILE_CHANGES_UNSTAGED))
 		gitg_changed_file_set_status(file, GITG_CHANGED_FILE_STATUS_MODIFIED);
 	
-	if (gitg_changed_file_get_status(file) == GITG_CHANGED_FILE_STATUS_NEW &&
+	if (status == GITG_CHANGED_FILE_STATUS_NEW &&
 	    !(changes & GITG_CHANGED_FILE_CHANGES_CACHED))
 	{
 		gitg_changed_file_set_changes(file, GITG_CHANGED_FILE_CHANGES_UNSTAGED);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]