diff mbox series

[v3,09/14] update-index: use add_index_entry()

Message ID 8016b089556c7ae3633480a4e11c0b2ef055cd42.1610136177.git.gitgitgadget@gmail.com (mailing list archive)
State New, archived
Headers show
Series Remove more index compatibility macros | expand

Commit Message

Derrick Stolee Jan. 8, 2021, 8:02 p.m. UTC
From: Derrick Stolee <dstolee@microsoft.com>

This is a mechanical replacement of add_cache_entry().

Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
---
 builtin/update-index.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/builtin/update-index.c b/builtin/update-index.c
index 87fbc580032..a1e4ee89056 100644
--- a/builtin/update-index.c
+++ b/builtin/update-index.c
@@ -293,7 +293,7 @@  static int add_one_path(const struct cache_entry *old, const char *path, int len
 	}
 	option = allow_add ? ADD_CACHE_OK_TO_ADD : 0;
 	option |= allow_replace ? ADD_CACHE_OK_TO_REPLACE : 0;
-	if (add_cache_entry(ce, option)) {
+	if (add_index_entry(istate, ce, option)) {
 		discard_cache_entry(ce);
 		return error("%s: cannot add to the index - missing --add option?", path);
 	}
@@ -672,12 +672,12 @@  static int unresolve_one(const char *path)
 	}
 
 	remove_file_from_index(repo->index, path);
-	if (add_cache_entry(ce_2, ADD_CACHE_OK_TO_ADD)) {
+	if (add_index_entry(repo->index, ce_2, ADD_CACHE_OK_TO_ADD)) {
 		error("%s: cannot add our version to the index.", path);
 		ret = -1;
 		goto free_return;
 	}
-	if (!add_cache_entry(ce_3, ADD_CACHE_OK_TO_ADD))
+	if (!add_index_entry(repo->index, ce_3, ADD_CACHE_OK_TO_ADD))
 		return 0;
 	error("%s: cannot add their version to the index.", path);
 	ret = -1;