From d850b7a545fcfbd97460a921c7f7c59d933eb0f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= Date: Tue, 28 Mar 2023 15:58:46 +0200 Subject: cocci: apply the "cache.h" part of "the_repository.pending" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Apply the part of "the_repository.pending.cocci" pertaining to "cache.h". Signed-off-by: Ævar Arnfjörð Bjarmason Signed-off-by: Junio C Hamano --- remote.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'remote.c') diff --git a/remote.c b/remote.c index 60869beebe..ff9b023831 100644 --- a/remote.c +++ b/remote.c @@ -1163,7 +1163,7 @@ static int try_explicit_object_name(const char *name, return 0; } - if (get_oid(name, &oid)) + if (repo_get_oid(the_repository, name, &oid)) return -1; if (match) { @@ -1251,7 +1251,7 @@ static void show_push_unqualified_ref_name_error(const char *dst_value, if (!advice_enabled(ADVICE_PUSH_UNQUALIFIED_REF_NAME)) return; - if (get_oid(matched_src_name, &oid)) + if (repo_get_oid(the_repository, matched_src_name, &oid)) BUG("'%s' is not a valid object, " "match_explicit_lhs() should catch this!", matched_src_name); @@ -2505,7 +2505,7 @@ static int parse_push_cas_option(struct push_cas_option *cas, const char *arg, i entry->use_tracking = 1; else if (!colon[1]) oidclr(&entry->expect); - else if (get_oid(colon + 1, &entry->expect)) + else if (repo_get_oid(the_repository, colon + 1, &entry->expect)) return error(_("cannot parse expected object name '%s'"), colon + 1); return 0; -- cgit v1.2.3 From cb338c23d6d518947bf6f7240bf30e2ec232bd3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= Date: Tue, 28 Mar 2023 15:58:47 +0200 Subject: cocci: apply the "commit-reach.h" part of "the_repository.pending" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Apply the part of "the_repository.pending.cocci" pertaining to "commit-reach.h". Signed-off-by: Ævar Arnfjörð Bjarmason Signed-off-by: Junio C Hamano --- remote.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'remote.c') diff --git a/remote.c b/remote.c index ff9b023831..71b1ae2db0 100644 --- a/remote.c +++ b/remote.c @@ -2662,7 +2662,7 @@ static int is_reachable_in_reflog(const char *local, const struct ref *remote) if (MERGE_BASES_BATCH_SIZE < size) size = MERGE_BASES_BATCH_SIZE; - if ((ret = in_merge_bases_many(commit, size, chunk))) + if ((ret = repo_in_merge_bases_many(the_repository, commit, size, chunk))) break; } -- cgit v1.2.3 From bc726bd075929aab6b3e09d4dd5c2b0726fd5350 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= Date: Tue, 28 Mar 2023 15:58:50 +0200 Subject: cocci: apply the "object-store.h" part of "the_repository.pending" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Apply the part of "the_repository.pending.cocci" pertaining to "object-store.h". Signed-off-by: Ævar Arnfjörð Bjarmason Signed-off-by: Junio C Hamano --- remote.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'remote.c') diff --git a/remote.c b/remote.c index 71b1ae2db0..12f6bea625 100644 --- a/remote.c +++ b/remote.c @@ -1759,7 +1759,7 @@ void set_ref_status_for_push(struct ref *remote_refs, int send_mirror, if (!reject_reason && !ref->deletion && !is_null_oid(&ref->old_oid)) { if (starts_with(ref->name, "refs/tags/")) reject_reason = REF_STATUS_REJECT_ALREADY_EXISTS; - else if (!has_object_file(&ref->old_oid)) + else if (!repo_has_object_file(the_repository, &ref->old_oid)) reject_reason = REF_STATUS_REJECT_FETCH_FIRST; else if (!lookup_commit_reference_gently(the_repository, &ref->old_oid, 1) || !lookup_commit_reference_gently(the_repository, &ref->new_oid, 1)) -- cgit v1.2.3 From 12cb1c10a64170a5d600dd1c6c8abfeec105fb6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= Date: Tue, 28 Mar 2023 15:58:54 +0200 Subject: cocci: apply the "refs.h" part of "the_repository.pending" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Apply the part of "the_repository.pending.cocci" pertaining to "refs.h". Signed-off-by: Ævar Arnfjörð Bjarmason Signed-off-by: Junio C Hamano --- remote.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'remote.c') diff --git a/remote.c b/remote.c index 12f6bea625..a03b03e467 100644 --- a/remote.c +++ b/remote.c @@ -1808,8 +1808,9 @@ static void set_merge(struct remote_state *remote_state, struct branch *ret) if (!remote_find_tracking(remote, ret->merge[i]) || strcmp(ret->remote_name, ".")) continue; - if (dwim_ref(ret->merge_name[i], strlen(ret->merge_name[i]), - &oid, &ref, 0) == 1) + if (repo_dwim_ref(the_repository, ret->merge_name[i], + strlen(ret->merge_name[i]), &oid, &ref, + 0) == 1) ret->merge[i]->dst = ref; else ret->merge[i]->dst = xstrdup(ret->merge_name[i]); -- cgit v1.2.3