diff options
author | Junio C Hamano <gitster@pobox.com> | 2024-05-16 19:10:13 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2024-05-16 19:10:14 +0200 |
commit | bca900904d854babf2493d57c0fee3ab421fe750 (patch) | |
tree | e664fba784c58d391ddf22c32222b0212b670171 /builtin/submodule--helper.c | |
parent | Merge branch 'jl/git-no-advice' (diff) | |
parent | refs: remove functions without ref store (diff) | |
download | git-bca900904d854babf2493d57c0fee3ab421fe750.tar.xz git-bca900904d854babf2493d57c0fee3ab421fe750.zip |
Merge branch 'ps/refs-without-the-repository'
The refs API lost functions that implicitly assumes to work on the
primary ref_store by forcing the callers to pass a ref_store as an
argument.
* ps/refs-without-the-repository:
refs: remove functions without ref store
cocci: apply rules to rewrite callers of "refs" interfaces
cocci: introduce rules to transform "refs" to pass ref store
refs: add `exclude_patterns` parameter to `for_each_fullref_in()`
refs: introduce missing functions that accept a `struct ref_store`
Diffstat (limited to 'builtin/submodule--helper.c')
-rw-r--r-- | builtin/submodule--helper.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/builtin/submodule--helper.c b/builtin/submodule--helper.c index c968ca793b..e604cb5ddb 100644 --- a/builtin/submodule--helper.c +++ b/builtin/submodule--helper.c @@ -2456,7 +2456,9 @@ static int remote_submodule_branch(const char *path, const char **branch) } if (!strcmp(*branch, ".")) { - const char *refname = resolve_ref_unsafe("HEAD", 0, NULL, NULL); + const char *refname = refs_resolve_ref_unsafe(get_main_ref_store(the_repository), + "HEAD", 0, NULL, + NULL); if (!refname) return die_message(_("No such ref: %s"), "HEAD"); @@ -2874,7 +2876,8 @@ static int push_check(int argc, const char **argv, const char *prefix UNUSED) argv++; argc--; /* Get the submodule's head ref and determine if it is detached */ - head = resolve_refdup("HEAD", 0, &head_oid, NULL); + head = refs_resolve_refdup(get_main_ref_store(the_repository), "HEAD", + 0, &head_oid, NULL); if (!head) die(_("Failed to resolve HEAD as a valid ref.")); if (!strcmp(head, "HEAD")) |