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
This commit is contained in:
Junio C Hamano
2024-01-29 16:03:00 -08:00
2 changed files with 28 additions and 0 deletions

View File

@ -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;
}