summaryrefslogtreecommitdiff
path: root/diff.c
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2006-02-10 18:47:41 -0800
committerJunio C Hamano <junkio@cox.net>2006-02-10 18:47:41 -0800
commit3f6726e1f112d221bd2a919e9b1b2927aeef6150 (patch)
tree9ee388cce7c0ce7f5db55f5de0379b48212e7229 /diff.c
parent9ae6be80163669db921e6522140900da41753ed5 (diff)
parentd416df8869d803282fb254a18505eccceee9ba3e (diff)
downloadgit-3f6726e1f112d221bd2a919e9b1b2927aeef6150.tar.gz
Merge branch 'lt/diff-tree'
* lt/diff-tree: combine-diff: Record diff status a bit more faithfully find_unique_abbrev() simplification. combine-diff: move formatting logic to show_combined_diff() combined-diff: use diffcore before intersecting paths. diff-tree -c raw output
Diffstat (limited to 'diff.c')
-rw-r--r--diff.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/diff.c b/diff.c
index ec51e7dd18..890bdaa6b8 100644
--- a/diff.c
+++ b/diff.c
@@ -963,7 +963,7 @@ void diff_free_filepair(struct diff_filepair *p)
}
/* This is different from find_unique_abbrev() in that
- * it needs to deal with 0{40} SHA1.
+ * it stuffs the result with dots for alignment.
*/
const char *diff_unique_abbrev(const unsigned char *sha1, int len)
{
@@ -973,16 +973,8 @@ const char *diff_unique_abbrev(const unsigned char *sha1, int len)
return sha1_to_hex(sha1);
abbrev = find_unique_abbrev(sha1, len);
- if (!abbrev) {
- if (!memcmp(sha1, null_sha1, 20)) {
- char *buf = sha1_to_hex(null_sha1);
- if (len < 37)
- strcpy(buf + len, "...");
- return buf;
- }
- else
- return sha1_to_hex(sha1);
- }
+ if (!abbrev)
+ return sha1_to_hex(sha1);
abblen = strlen(abbrev);
if (abblen < 37) {
static char hex[41];