]> Kevux Git Server - rit/commit
tree-diff: clear parent array in path_appendnew()
authorJeff King <peff@peff.net>
Thu, 9 Jan 2025 08:33:10 +0000 (03:33 -0500)
committerJunio C Hamano <gitster@pobox.com>
Thu, 9 Jan 2025 18:05:50 +0000 (10:05 -0800)
commit5173099aae25bedf7a87225891d124569cba7076
treee9b44011c990188039296bb1c025831071fd1640
parent706779344155823518745a19515601905877c41f
tree-diff: clear parent array in path_appendnew()

All of the other functions which allocate a combine_diff_path struct
zero out the parent array, but this code path does not. There's no bug,
since our caller will fill in most of the fields. But leaving the unused
fields (like combine_diff_parent.path) uninitialized makes working with
the struct more error-prone than it needs to be.

Let's just zero the parent field to be consistent with the
combine_diff_path_new() allocator.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
tree-diff.c