aboutsummaryrefslogtreecommitdiff
path: root/builtin/diff-tree.c
diff options
context:
space:
mode:
authorAlexander Rinass <alex@fournova.com>2016-05-13 22:41:02 +0200
committerJunio C Hamano <gitster@pobox.com>2016-05-13 14:35:49 -0700
commit90a78b83e0b812d1f42501a54372720def4ddd84 (patch)
tree9e1d4ed51806d4643b3460c585381b1f971593cb /builtin/diff-tree.c
parent765428699a5381f113d19974720bc91b5bfeaf1d (diff)
downloadgit-90a78b83e0b812d1f42501a54372720def4ddd84.tar.gz
git-90a78b83e0b812d1f42501a54372720def4ddd84.tar.xz
diff: run arguments through precompose_argv
When running diff commands, a pathspec containing decomposed unicode code points is not converted to precomposed unicode form under Mac OS X, but we normalize the paths in the index and the history to precomposed form on that platform. As a result, the pathspec would not match and no diff is shown. Unlike many builtin commands, the "diff" family of commands do not use parse_options(), which is how other builtin commands indirectly call precompose_argv() to normalize argv[] into precomposed form on Mac OSX. Teach these commands to call precompose_argv() themselves. Note that precomopose_argv() normalizes not just paths but all command line arguments, so things like "git diff -G $string" when $string has the decomposed form would first be normalized into the precomposed form and would stop hitting the same string in the decomposed form in the diff output with this change. It is not a problem per-se, as "log" family of commands already use parse_options() and call precompose_argv()--we can think of this change as making the "diff" family of commands behave in a similar way as the commands in the "log" family. Signed-off-by: Alexander Rinass <alex@fournova.com> Helped-by: Torsten Bòˆgershausen <tboegi@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/diff-tree.c')
-rw-r--r--builtin/diff-tree.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/builtin/diff-tree.c b/builtin/diff-tree.c
index 12b683d02..7969e2225 100644
--- a/builtin/diff-tree.c
+++ b/builtin/diff-tree.c
@@ -114,6 +114,8 @@ int cmd_diff_tree(int argc, const char **argv, const char *prefix)
opt->disable_stdin = 1;
memset(&s_r_opt, 0, sizeof(s_r_opt));
s_r_opt.tweak = diff_tree_tweak_rev;
+
+ precompose_argv(argc, argv);
argc = setup_revisions(argc, argv, opt, &s_r_opt);
while (--argc > 0) {