Merge branch 'jh/diff-index-line-abbrev' into next

* jh/diff-index-line-abbrev:
  diff.c: Ensure "index $from..$to" line contains unambiguous SHA1s

Conflicts:
	diff.c
This commit is contained in:
Junio C Hamano
2010-06-07 22:15:46 -07:00
2 changed files with 38 additions and 3 deletions

6
diff.c
View File

@@ -2430,9 +2430,9 @@ static void fill_metainfo(struct strbuf *msg,
(!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, "%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_addf(msg, "%s\n", reset);