diff options
author | Junio C Hamano <gitster@pobox.com> | 2024-01-30 01:03:00 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2024-01-30 01:03:00 +0100 |
commit | d3bf8d32d32e628e551a71004f7c6f60d87f1a39 (patch) | |
tree | a36a4cab276e7abe4112cfd3e8f29210c749138f /diffcore-delta.c | |
parent | Merge branch 'ps/not-so-many-refs-are-special' (diff) | |
parent | diffcore-delta: avoid ignoring final 'line' of file (diff) | |
download | git-d3bf8d32d32e628e551a71004f7c6f60d87f1a39.tar.xz git-d3bf8d32d32e628e551a71004f7c6f60d87f1a39.zip |
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.c | 4 |
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; } |