Code

Fix index refreshing into separate call so diff-files is always run
authorJonas Fonseca <fonseca@diku.dk>
Thu, 20 Mar 2008 12:21:40 +0000 (13:21 +0100)
committerJonas Fonseca <fonseca@diku.dk>
Thu, 20 Mar 2008 12:34:30 +0000 (13:34 +0100)
tig.c

diff --git a/tig.c b/tig.c
index 1ae0a1e19c7f3226938d57b287fa327be37fa687..73aa9913c7a3a248975565850ac6ec1a0512f262 100644 (file)
--- a/tig.c
+++ b/tig.c
@@ -3356,7 +3356,7 @@ error_out:
 
 /* Don't show unmerged entries in the staged section. */
 #define STATUS_DIFF_INDEX_CMD "git diff-index -z --diff-filter=ACDMRTXB --cached -M HEAD"
-#define STATUS_DIFF_FILES_CMD "git update-index -q --refresh && git diff-files -z"
+#define STATUS_DIFF_FILES_CMD "git diff-files -z"
 #define STATUS_LIST_OTHER_CMD \
        "git ls-files -z --others --exclude-per-directory=.gitignore"
 
@@ -3400,6 +3400,8 @@ status_open(struct view *view)
                        return FALSE;
        }
 
+       system("git update-index -q --refresh");
+
        if (!status_run(view, STATUS_DIFF_INDEX_CMD, TRUE, LINE_STAT_STAGED) ||
            !status_run(view, STATUS_DIFF_FILES_CMD, TRUE, LINE_STAT_UNSTAGED) ||
            !status_run(view, cmd, FALSE, LINE_STAT_UNTRACKED))