diff mbox series

[v3,07/14] update-index: use index_name_pos() over cache_name_pos()

Message ID fc640ae6e652c175e2bbbe7bba3b856ae20265d1.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>

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

Patch

diff --git a/builtin/update-index.c b/builtin/update-index.c
index 70ca47e712c..a24b1fc90e4 100644
--- a/builtin/update-index.c
+++ b/builtin/update-index.c
@@ -232,7 +232,7 @@  static struct index_state *istate;
 static int mark_ce_flags(const char *path, int flag, int mark)
 {
 	int namelen = strlen(path);
-	int pos = cache_name_pos(path, namelen);
+	int pos = index_name_pos(istate, path, namelen);
 	if (0 <= pos) {
 		mark_fsmonitor_invalid(istate, istate->cache[pos]);
 		if (mark)
@@ -326,7 +326,7 @@  static int add_one_path(const struct cache_entry *old, const char *path, int len
 static int process_directory(const char *path, int len, struct stat *st)
 {
 	struct object_id oid;
-	int pos = cache_name_pos(path, len);
+	int pos = index_name_pos(istate, path, len);
 
 	/* Exact match: file or existing gitlink */
 	if (pos >= 0) {
@@ -376,7 +376,7 @@  static int process_path(const char *path, struct stat *st, int stat_errno)
 	if (has_symlink_leading_path(path, len))
 		return error("'%s' is beyond a symbolic link", path);
 
-	pos = cache_name_pos(path, len);
+	pos = index_name_pos(istate, path, len);
 	ce = pos < 0 ? NULL : istate->cache[pos];
 	if (ce && ce_skip_worktree(ce)) {
 		/*
@@ -425,7 +425,7 @@  static void chmod_path(char flip, const char *path)
 	int pos;
 	struct cache_entry *ce;
 
-	pos = cache_name_pos(path, strlen(path));
+	pos = index_name_pos(istate, path, strlen(path));
 	if (pos < 0)
 		goto fail;
 	ce = istate->cache[pos];
@@ -623,7 +623,7 @@  static int unresolve_one(const char *path)
 	struct cache_entry *ce_2 = NULL, *ce_3 = NULL;
 
 	/* See if there is such entry in the index. */
-	pos = cache_name_pos(path, namelen);
+	pos = index_name_pos(repo->index, path, namelen);
 	if (0 <= pos) {
 		/* already merged */
 		pos = unmerge_cache_entry_at(pos);