Refresh the index when opening the status view to avoid "empty diffs"
authorJonas Fonseca <fonseca@diku.dk>
Mon, 17 Mar 2008 13:58:51 +0000 (14:58 +0100)
committerJonas Fonseca <fonseca@diku.dk>
Mon, 17 Mar 2008 14:01:13 +0000 (15:01 +0100)
tig.c

diff --git a/tig.c b/tig.c
index 8f78697..71ddbb5 100644 (file)
--- a/tig.c
+++ b/tig.c
@@ -3324,7 +3324,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 diff-files -z"
+#define STATUS_DIFF_FILES_CMD "git update-index -q --refresh && git diff-files -z"
 #define STATUS_LIST_OTHER_CMD \
        "git ls-files -z --others --exclude-per-directory=.gitignore"