]> Kevux Git Server - rit/commit
add-patch: modify patch_update_file() signature
authorAbraham Samuel Adekunle <abrahamadekunle50@gmail.com>
Sat, 14 Feb 2026 11:04:44 +0000 (12:04 +0100)
committerJunio C Hamano <gitster@pobox.com>
Tue, 17 Feb 2026 18:48:37 +0000 (10:48 -0800)
commit57088095e90a940d232e36594c6fa761f283d35d
tree840e788646f429f90e924ee486d32437ed556a76
parent06c81a1118a6c9a77505b0ae3092576fa4c01763
add-patch: modify patch_update_file() signature

The function `patch_update_file()` takes the add_p_state struct
pointer and the current `struct file_diff` pointer and returns an
int.

When using the `--no-auto-advance` flag, we want to be able to request
the next or previous file from the caller.

Modify the function signature to instead take the index of the
current `file_diff` and the `add_p_state` struct pointer so that we
can compute the `file_diff` from the index while also having
access to the file index. This will help us request the next or
previous file from the caller.

Signed-off-by: Abraham Samuel Adekunle <abrahamadekunle50@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
add-patch.c