[PATCH v3 10/14] update-index: replace several compatibility macros
- From
Derrick Stolee via GitGitGadget <gitgitgadget@gmail.com>
- Date
- Jan 8, 2021, 20:02 UTC
- Message-ID
- <efe9fddd0a9a44d6fb04eeb01d2868fe7829f2f6.1610136177.git.gitgitgadget@gmail.com>
- In-Reply-To
- <pull.830.v3.git.1610136177.gitgitgadget@gmail.com>
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 --git a/builtin/update-index.c b/builtin/update-index.c index a1e4ee89056..64feb47c97f 100644 --- a/builtin/update-index.c +++ b/builtin/update-index.c @@ -429,7 +429,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); @@ -626,7 +626,7 @@ static int unresolve_one(const char *path) pos = index_name_pos(repo->index, path, namelen); if (0 <= pos) { /* already merged */ - pos = unmerge_cache_entry_at(pos); + pos = unmerge_index_entry_at(repo->index, pos); if (pos < repo->index->cache_nr) { const struct cache_entry *ce = repo->index->cache[pos]; if (ce_stage(ce) && @@ -777,8 +777,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(repo->index, o->flags | flag, + NULL, NULL, NULL); return 0; } @@ -814,7 +815,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(repo->index); return 0; } diff --git a/cache.h b/cache.h index fdf061cac56..8c091be6256 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))
-- gitgitgadget