diff mbox series

[11/12] update-index: replace several compatibility macros

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

Commit Message

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

This is also the last usage of unmerge_cache_entry_at(), so it can be
removed from cache.h.

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

Patch

diff --git a/builtin/update-index.c b/builtin/update-index.c
index 577ae2391b7..4da0c169dc7 100644
--- a/builtin/update-index.c
+++ b/builtin/update-index.c
@@ -441,7 +441,7 @@  static void chmod_path(char flip, const char *path)
 	if (pos < 0)
 		goto fail;
 	ce = istate->cache[pos];
-	if (chmod_cache_entry(ce, flip) < 0)
+	if (chmod_index_entry(istate, ce, flip) < 0)
 		goto fail;
 
 	report("chmod %cx '%s'", flip, path);
@@ -637,7 +637,7 @@  static int unresolve_one(const char *path)
 	pos = index_name_pos(istate, path, namelen);
 	if (0 <= pos) {
 		/* already merged */
-		pos = unmerge_cache_entry_at(pos);
+		pos = unmerge_index_entry_at(istate, pos);
 		if (pos < istate->cache_nr) {
 			const struct cache_entry *ce = istate->cache[pos];
 			if (ce_stage(ce) &&
@@ -788,8 +788,9 @@  struct refresh_params {
 static int refresh(struct refresh_params *o, unsigned int flag)
 {
 	setup_work_tree();
-	read_cache();
-	*o->has_errors |= refresh_cache(o->flags | flag);
+	repo_read_index(repo);
+	*o->has_errors |= refresh_index(istate, o->flags | flag,
+					NULL, NULL, NULL);
 	return 0;
 }
 
@@ -825,7 +826,7 @@  static int resolve_undo_clear_callback(const struct option *opt,
 {
 	BUG_ON_OPT_NEG(unset);
 	BUG_ON_OPT_ARG(arg);
-	resolve_undo_clear();
+	resolve_undo_clear_index(istate);
 	return 0;
 }
 
diff --git a/cache.h b/cache.h
index 7bfb8195d97..dfcbc4923e2 100644
--- a/cache.h
+++ b/cache.h
@@ -421,7 +421,6 @@  extern struct index_state the_index;
 #define cache_dir_exists(name, namelen) index_dir_exists(&the_index, (name), (namelen))
 #define cache_name_is_other(name, namelen) index_name_is_other(&the_index, (name), (namelen))
 #define resolve_undo_clear() resolve_undo_clear_index(&the_index)
-#define unmerge_cache_entry_at(at) unmerge_index_entry_at(&the_index, at)
 #define unmerge_cache(pathspec) unmerge_index(&the_index, pathspec)
 #define read_blob_data_from_cache(path, sz) read_blob_data_from_index(&the_index, (path), (sz))
 #define hold_locked_index(lock_file, flags) repo_hold_locked_index(the_repository, (lock_file), (flags))