author | Junio C Hamano <gitster@pobox.com> | |
Fri, 18 Jun 2010 18:16:56 +0000 (11:16 -0700) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Fri, 18 Jun 2010 18:16:56 +0000 (11:16 -0700) |
* jh/diff-index-line-abbrev:
diff.c: Ensure "index $from..$to" line contains unambiguous SHA1s
Conflicts:
diff.c
diff.c: Ensure "index $from..$to" line contains unambiguous SHA1s
Conflicts:
diff.c
1 | 2 | |||
---|---|---|---|---|
diff.c | patch | | diff1 | | diff2 | | blob | history |
diff --cc diff.c
index c82b605a942b8611c3eaf0e41a173185fdb40779,1aefa663752965169c8cc5e0e40147c956bc4917..b53b6ec8e2ced8c94c0353dddf07ca5c1dd79978
+++ b/diff.c
(!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,