From 90a78b83e0b812d1f42501a54372720def4ddd84 Mon Sep 17 00:00:00 2001 From: Alexander Rinass Date: Fri, 13 May 2016 22:41:02 +0200 Subject: diff: run arguments through precompose_argv MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Helped-by: Torsten Bòˆgershausen Signed-off-by: Junio C Hamano --- builtin/diff-files.c | 1 + 1 file changed, 1 insertion(+) (limited to 'builtin/diff-files.c') diff --git a/builtin/diff-files.c b/builtin/diff-files.c index 8ed2eb8813..15c61fd8d1 100644 --- a/builtin/diff-files.c +++ b/builtin/diff-files.c @@ -24,6 +24,7 @@ int cmd_diff_files(int argc, const char **argv, const char *prefix) gitmodules_config(); git_config(git_diff_basic_config, NULL); /* no "diff" UI options */ rev.abbrev = 0; + precompose_argv(argc, argv); argc = setup_revisions(argc, argv, &rev, NULL); while (1 < argc && argv[1][0] == '-') { -- cgit v1.2.3