From: Junio C Hamano Date: Fri, 10 Feb 2006 14:51:28 +0000 (-0800) Subject: Merge branch 'lt/diff-tree' X-Git-Tag: v1.3.0-rc1~54^2~86 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/f732d0b8576303403db2b1824cfd8b5a2fe632ef?hp=-c Merge branch 'lt/diff-tree' * lt/diff-tree: combine-diff: Record diff status a bit more faithfully find_unique_abbrev() simplification. --- f732d0b8576303403db2b1824cfd8b5a2fe632ef diff --combined diff.c index c72064eeb2,890bdaa6b8..804c08c2cf --- a/diff.c +++ b/diff.c @@@ -311,7 -311,7 +311,7 @@@ static int work_tree_matches(const cha ce = active_cache[pos]; if ((lstat(name, &st) < 0) || !S_ISREG(st.st_mode) || /* careful! */ - ce_match_stat(ce, &st) || + ce_match_stat(ce, &st, 0) || memcmp(sha1, ce->sha1, 20)) return 0; /* we return 1 only when we can stat, it is a regular file, @@@ -963,7 -963,7 +963,7 @@@ void diff_free_filepair(struct diff_fil } /* 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 +973,8 @@@ 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];