From 3abac994b5980c92b9b295d65cb538ccb432d04d Mon Sep 17 00:00:00 2001 From: Jonas Fonseca Date: Sat, 26 Apr 2014 12:11:57 -0400 Subject: [PATCH] Improve staged diffs to detect copying and not show unmerged files Unmerged files are already filtered from the status view's staged file group so they should not be shown in the stage view. By detecting copying (-C) instead of only renames the status view will show correctly situations where a file was both renamed and copied. --- include/tig/git.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/include/tig/git.h b/include/tig/git.h index 0f1b9db..ab7c138 100644 --- a/include/tig/git.h +++ b/include/tig/git.h @@ -27,7 +27,8 @@ #define GIT_DIFF_STAGED(encoding_arg, context_arg, space_arg, old_name, new_name) \ "git", "diff-index", (encoding_arg), "--root", "--patch-with-stat", "-C", "-M", \ - "--cached", (context_arg), (space_arg), "HEAD", "--", (old_name), (new_name), NULL + "--cached", "--diff-filter=ACDMRTXB", (context_arg), (space_arg), "HEAD", \ + "--", (old_name), (new_name), NULL #define GIT_DIFF_UNSTAGED(encoding_arg, context_arg, space_arg, old_name, new_name) \ "git", "diff-files", (encoding_arg), "--root", "--patch-with-stat", "-C", "-M", \ @@ -35,7 +36,7 @@ /* Don't show staged unmerged entries. */ #define GIT_DIFF_STAGED_FILES(output_arg) \ - "git", "diff-index", (output_arg), "--diff-filter=ACDMRTXB", "-M", "--cached", "HEAD", "--", NULL + "git", "diff-index", (output_arg), "--diff-filter=ACDMRTXB", "-C", "--cached", "HEAD", "--", NULL #define GIT_DIFF_UNSTAGED_FILES(output_arg) \ "git", "diff-files", (output_arg), NULL -- 2.11.4.GIT