summaryrefslogtreecommitdiff
path: root/t/t4013/diff.diff_initial..side
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2026-07-28 11:14:58 -0400
committerJunio C Hamano <gitster@pobox.com>2026-07-28 09:12:24 -0700
commit447126ed7df66b396235766547a57649f925aac2 (patch)
treef130ecd06bdfb3fd8734defd697f91cc9df9f594 /t/t4013/diff.diff_initial..side
parent88efab5c3b7b7585a3b4f45db89c108fef9a04f2 (diff)
diff-lib: add idx/tree sanity check to oneway_diff
When looking just at the code in oneway_diff(), it seems possible for both "idx" and "tree" to be NULL, in which case we'd potentially segfault while checking the relative prefix. But if you consider what these items actually mean, it shouldn't be possible for both to be NULL. Let's add an assertion and a comment documenting this. It might help human readers, but should also silence static analyzers like Coverity which complain about the potential segfault. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t4013/diff.diff_initial..side')
0 files changed, 0 insertions, 0 deletions