aboutsummaryrefslogtreecommitdiffstats
path: root/diffcore-delta.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2024-01-29 16:03:00 -0800
committerJunio C Hamano <gitster@pobox.com>2024-01-29 16:03:00 -0800
commitd3bf8d32d32e628e551a71004f7c6f60d87f1a39 (patch)
treea36a4cab276e7abe4112cfd3e8f29210c749138f /diffcore-delta.c
parent8282f9592838acd265491737e4d36636fc64b639 (diff)
parent1c5bc6971e28c581b17b812cbbd1f09e39f0bb63 (diff)
downloadgit-d3bf8d32d32e628e551a71004f7c6f60d87f1a39.tar.gz
Merge branch 'en/diffcore-delta-final-line-fix'
Rename detection logic ignored the final line of a file if it is an incomplete line. * en/diffcore-delta-final-line-fix: diffcore-delta: avoid ignoring final 'line' of file
Diffstat (limited to 'diffcore-delta.c')
-rw-r--r--diffcore-delta.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/diffcore-delta.c b/diffcore-delta.c
index 4927ab8fb0..ba6cbee76b 100644
--- a/diffcore-delta.c
+++ b/diffcore-delta.c
@@ -158,6 +158,10 @@ static struct spanhash_top *hash_chars(struct repository *r,
n = 0;
accum1 = accum2 = 0;
}
+ if (n > 0) {
+ hashval = (accum1 + accum2 * 0x61) % HASHBASE;
+ hash = add_spanhash(hash, hashval, n);
+ }
QSORT(hash->data, (size_t)1ul << hash->alloc_log2, spanhash_cmp);
return hash;
}