From: Junio C Hamano Date: Mon, 6 Jun 2016 21:27:35 +0000 (-0700) Subject: Merge branch 'ar/diff-args-osx-precompose' into maint X-Git-Tag: v2.8.4~4 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/05781d37fa43b5dada77d1bcfd4cdc42742e7421?ds=sidebyside;hp=-c Merge branch 'ar/diff-args-osx-precompose' into maint Many commands normalize command line arguments from NFD to NFC variant of UTF-8 on OSX, but commands in the "diff" family did not, causing "git diff $path" to complain that no such path is known to Git. They have been taught to do the normalization. * ar/diff-args-osx-precompose: diff: run arguments through precompose_argv --- 05781d37fa43b5dada77d1bcfd4cdc42742e7421 diff --combined builtin/diff-tree.c index 2a12b81e06,7969e22252..806dd7a885 --- a/builtin/diff-tree.c +++ b/builtin/diff-tree.c @@@ -49,9 -49,9 +49,9 @@@ static int stdin_diff_trees(struct tre tree2 = lookup_tree(sha1); if (!tree2 || parse_tree(tree2)) return -1; - printf("%s %s\n", sha1_to_hex(tree1->object.sha1), - sha1_to_hex(tree2->object.sha1)); - diff_tree_sha1(tree1->object.sha1, tree2->object.sha1, + printf("%s %s\n", oid_to_hex(&tree1->object.oid), + oid_to_hex(&tree2->object.oid)); + diff_tree_sha1(tree1->object.oid.hash, tree2->object.oid.hash, "", &log_tree_opt.diffopt); log_tree_diff_flush(&log_tree_opt); return 0; @@@ -114,6 -114,8 +114,8 @@@ int cmd_diff_tree(int argc, const char 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) { @@@ -139,7 -141,7 +141,7 @@@ break; case 1: tree1 = opt->pending.objects[0].item; - diff_tree_commit_sha1(tree1->sha1); + diff_tree_commit_sha1(tree1->oid.hash); break; case 2: tree1 = opt->pending.objects[0].item; @@@ -149,8 -151,8 +151,8 @@@ tree2 = tree1; tree1 = tmp; } - diff_tree_sha1(tree1->sha1, - tree2->sha1, + diff_tree_sha1(tree1->oid.hash, + tree2->oid.hash, "", &opt->diffopt); log_tree_diff_flush(opt); break; diff --combined builtin/diff.c index 52c98a9217,5b8039cbc7..d6b8f9834d --- a/builtin/diff.c +++ b/builtin/diff.c @@@ -175,8 -175,8 +175,8 @@@ static int builtin_diff_tree(struct rev */ if (ent1->item->flags & UNINTERESTING) swap = 1; - sha1[swap] = ent0->item->sha1; - sha1[1 - swap] = ent1->item->sha1; + sha1[swap] = ent0->item->oid.hash; + sha1[1 - swap] = ent1->item->oid.hash; diff_tree_sha1(sha1[0], sha1[1], "", &revs->diffopt); log_tree_diff_flush(revs); return 0; @@@ -196,8 -196,8 +196,8 @@@ static int builtin_diff_combined(struc if (!revs->dense_combined_merges && !revs->combine_merges) revs->dense_combined_merges = revs->combine_merges = 1; for (i = 1; i < ents; i++) - sha1_array_append(&parents, ent[i].item->sha1); - diff_tree_combined(ent[0].item->sha1, &parents, + sha1_array_append(&parents, ent[i].item->oid.hash); + diff_tree_combined(ent[0].item->oid.hash, &parents, revs->dense_combined_merges, revs); sha1_array_clear(&parents); return 0; @@@ -319,6 -319,7 +319,7 @@@ int cmd_diff(int argc, const char **arg if (!no_index) gitmodules_config(); git_config(git_diff_ui_config, NULL); + precompose_argv(argc, argv); init_revisions(&rev, prefix); @@@ -341,7 -342,7 +342,7 @@@ } if (no_index) /* If this is a no-index diff, just run it and exit there. */ - diff_no_index(&rev, argc, argv, prefix); + diff_no_index(&rev, argc, argv); /* Otherwise, we are doing the usual "git" diff */ rev.diffopt.skip_stat_unmatch = !!diff_auto_refresh_index; @@@ -395,7 -396,7 +396,7 @@@ const char *name = entry->name; int flags = (obj->flags & UNINTERESTING); if (!obj->parsed) - obj = parse_object(obj->sha1); + obj = parse_object(obj->oid.hash); obj = deref_tag(obj, NULL, 0); if (!obj) die(_("invalid object '%s' given."), name); @@@ -408,7 -409,7 +409,7 @@@ } else if (obj->type == OBJ_BLOB) { if (2 <= blobs) die(_("more than two blobs given: '%s'"), name); - hashcpy(blob[blobs].sha1, obj->sha1); + hashcpy(blob[blobs].sha1, obj->oid.hash); blob[blobs].name = name; blob[blobs].mode = entry->mode; blobs++;