diff options
author | Ævar Arnfjörð Bjarmason <avarab@gmail.com> | 2022-11-19 14:07:30 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2022-11-21 04:06:15 +0100 |
commit | fbc1ed629e3c71b47a04ab86b88497984bc6acbb (patch) | |
tree | cf27ce492fa8afbf46027aaca6f67cf3c3d99bd7 /builtin/update-index.c | |
parent | builtin/{grep,log}.: don't define "USE_THE_INDEX_COMPATIBILITY_MACROS" (diff) | |
download | git-fbc1ed629e3c71b47a04ab86b88497984bc6acbb.tar.xz git-fbc1ed629e3c71b47a04ab86b88497984bc6acbb.zip |
cocci & cache.h: remove rarely used "the_index" compat macros
Since 4aab5b46f44 (Make read-cache.c "the_index" free., 2007-04-01)
we've been undergoing a slow migration away from these macros, but
haven't made much progress since f8adbec9fea (cache.h: flip
NO_THE_INDEX_COMPATIBILITY_MACROS switch, 2019-01-24).
Let's move forward a bit by changing the users of those macros that
are rare enough that we can convert them in one go, and then remove
the compatibility shim.
The only manual change to the C code here is to "cache.h", the rest is
all the result of applying the new "index-compatibility.cocci".
Even though it's a one-off, let's keep the coccinelle rules for
now. We'll extend them in subsequent commits, and this will help
anything that's in-flight or out-of-tree to migrate.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/update-index.c')
-rw-r--r-- | builtin/update-index.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/builtin/update-index.c b/builtin/update-index.c index 7b0c924d7d..e1b2bb78e7 100644 --- a/builtin/update-index.c +++ b/builtin/update-index.c @@ -445,7 +445,7 @@ static void chmod_path(char flip, const char *path) if (pos < 0) goto fail; ce = active_cache[pos]; - if (chmod_cache_entry(ce, flip) < 0) + if (chmod_index_entry(&the_index, ce, flip) < 0) goto fail; report("chmod %cx '%s'", flip, path); @@ -641,7 +641,7 @@ static int unresolve_one(const char *path) pos = cache_name_pos(path, namelen); if (0 <= pos) { /* already merged */ - pos = unmerge_cache_entry_at(pos); + pos = unmerge_index_entry_at(&the_index, pos); if (pos < active_nr) { const struct cache_entry *ce = active_cache[pos]; if (ce_stage(ce) && |