From: Junio C Hamano Date: Fri, 18 Jun 2010 18:16:56 +0000 (-0700) Subject: Merge branch 'jh/diff-index-line-abbrev' X-Git-Tag: v1.7.2-rc0~51 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=18fd805583130862632e40e98aecc7edcd16d878;p=git.git Merge branch 'jh/diff-index-line-abbrev' * jh/diff-index-line-abbrev: diff.c: Ensure "index $from..$to" line contains unambiguous SHA1s Conflicts: diff.c --- 18fd805583130862632e40e98aecc7edcd16d878 diff --cc diff.c index c82b605a9,1aefa6637..b53b6ec8e --- a/diff.c +++ b/diff.c @@@ -2430,13 -2419,15 +2430,13 @@@ static void fill_metainfo(struct strbu (!fill_mmfile(&mf, two) && diff_filespec_is_binary(two))) abbrev = 40; } - strbuf_addf(msg, "%sindex %.*s..%.*s", set, - abbrev, sha1_to_hex(one->sha1), - abbrev, sha1_to_hex(two->sha1)); - strbuf_addf(msg, "index %s..", ++ strbuf_addf(msg, "%sindex %s..", set, + find_unique_abbrev(one->sha1, abbrev)); + strbuf_addstr(msg, find_unique_abbrev(two->sha1, abbrev)); if (one->mode == two->mode) strbuf_addf(msg, " %06o", one->mode); - strbuf_addch(msg, '\n'); + strbuf_addf(msg, "%s\n", reset); } - if (msg->len) - strbuf_setlen(msg, msg->len - 1); } static void run_diff_cmd(const char *pgm,