From 9c5f3ee3b3a04182cc22630e9eb9fad95bd57fd7 Mon Sep 17 00:00:00 2001 From: Ævar Arnfjörð Bjarmason Date: Sat, 19 Nov 2022 14:07:31 +0100 Subject: read-cache API & users: make discard_index() return void MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The discard_index() function has not returned non-zero since 7a51ed66f65 (Make on-disk index representation separate from in-core one, 2008-01-14), but we've had various code in-tree still acting as though that might be the case. Signed-off-by: Ævar Arnfjörð Bjarmason Signed-off-by: Junio C Hamano --- add-patch.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'add-patch.c') diff --git a/add-patch.c b/add-patch.c index 33ecd8398a..a86a92e164 100644 --- a/add-patch.c +++ b/add-patch.c @@ -1750,7 +1750,8 @@ int run_add_p(struct repository *r, enum add_p_mode mode, s.mode = &patch_mode_add; s.revision = revision; - if (discard_index(r->index) < 0 || repo_read_index(r) < 0 || + discard_index(r->index); + if (repo_read_index(r) < 0 || (!s.mode->index_only && repo_refresh_and_write_index(r, REFRESH_QUIET, 0, 1, NULL, NULL, NULL) < 0) || -- cgit 1.2.3-korg