]> git.99rst.org Git - git.git/commit
read-cache: add remove_file_from_index_with_flags()
authorJunio C Hamano <redacted>
Fri, 31 Jul 2026 12:56:04 +0000 (05:56 -0700)
committerJunio C Hamano <redacted>
Fri, 31 Jul 2026 15:52:16 +0000 (08:52 -0700)
commit341ce9229e9b5619b686ed9d169b54e33b29f594
tree4891a0f8a0029d43247f1f63e8188eaadec5b6db
parente28c701fe41825013220e1b9fefe8da038070aa2
read-cache: add remove_file_from_index_with_flags()

add_file_to_index() takes flags such as ADD_CACHE_PRETEND and
ADD_CACHE_VERBOSE and internally handles both reporting (e.g.,
"add 'path'") and suppressing index updates during dry runs.

In contrast, remove_file_from_index() takes only istate and path
without flags.  Callers that perform file removals (such as
update_callback() in read-cache.c) are forced to manually inspect
ADD_CACHE_PRETEND and ADD_CACHE_VERBOSE flags for removed
files.

Introduce remove_file_from_index_with_flags() to encapsulate
pretend mode and verbose reporting for index removals.  Update
update_callback() to use the new helper.

Signed-off-by: Junio C Hamano <redacted>
read-cache-ll.h
read-cache.c
git clone https://git.99rst.org/PROJECT