aboutsummaryrefslogtreecommitdiffstats
path: root/builtin/am.c
diff options
context:
space:
mode:
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>2022-11-19 14:07:30 +0100
committerJunio C Hamano <gitster@pobox.com>2022-11-21 12:06:15 +0900
commitfbc1ed629e3c71b47a04ab86b88497984bc6acbb (patch)
treecf27ce492fa8afbf46027aaca6f67cf3c3d99bd7 /builtin/am.c
parentbuiltin/{grep,log}.: don't define "USE_THE_INDEX_COMPATIBILITY_MACROS" (diff)
downloadgit-fbc1ed629e3c71b47a04ab86b88497984bc6acbb.tar.gz
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/am.c')
-rw-r--r--builtin/am.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/builtin/am.c b/builtin/am.c
index 20aea0d248..f362a1c29f 100644
--- a/builtin/am.c
+++ b/builtin/am.c
@@ -1930,7 +1930,7 @@ static void am_resolve(struct am_state *state, int allow_empty)
}
}
- if (unmerged_cache()) {
+ if (unmerged_index(&the_index)) {
printf_ln(_("You still have unmerged paths in your index.\n"
"You should 'git add' each file with resolved conflicts to mark them as such.\n"
"You might run `git rm` on a file to accept \"deleted by them\" for it."));
@@ -2045,7 +2045,7 @@ static int clean_index(const struct object_id *head, const struct object_id *rem
if (!remote_tree)
return error(_("Could not parse object '%s'."), oid_to_hex(remote));
- read_cache_unmerged();
+ repo_read_index_unmerged(the_repository);
if (fast_forward_to(head_tree, head_tree, 1))
return -1;