Refresh the index when opening the status view to avoid "empty diffs"
[tig] / 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"