Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2023-04-06 23:38:30 +0300
committerJunio C Hamano <gitster@pobox.com>2023-04-06 23:38:30 +0300
commit72871b198f50962a555685726e42f435cdd4efa1 (patch)
tree1ebe027331745e509d7f873b7d3a030c863ee0a6 /remote.c
parent06e9e726d463b413d45703b31881de4ed99b3417 (diff)
parent4a93b899c19794c28b140bf78a13fb9c2b34f433 (diff)
Merge branch 'ab/remove-implicit-use-of-the-repository'
Code clean-up around the use of the_repository. * ab/remove-implicit-use-of-the-repository: libs: use "struct repository *" argument, not "the_repository" post-cocci: adjust comments for recent repo_* migration cocci: apply the "revision.h" part of "the_repository.pending" cocci: apply the "rerere.h" part of "the_repository.pending" cocci: apply the "refs.h" part of "the_repository.pending" cocci: apply the "promisor-remote.h" part of "the_repository.pending" cocci: apply the "packfile.h" part of "the_repository.pending" cocci: apply the "pretty.h" part of "the_repository.pending" cocci: apply the "object-store.h" part of "the_repository.pending" cocci: apply the "diff.h" part of "the_repository.pending" cocci: apply the "commit.h" part of "the_repository.pending" cocci: apply the "commit-reach.h" part of "the_repository.pending" cocci: apply the "cache.h" part of "the_repository.pending" cocci: add missing "the_repository" macros to "pending" cocci: sort "the_repository" rules by header cocci: fix incorrect & verbose "the_repository" rules cocci: remove dead rule from "the_repository.pending.cocci"
Diffstat (limited to 'remote.c')
-rw-r--r--remote.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/remote.c b/remote.c
index 641b083d90..f99122b0d3 100644
--- a/remote.c
+++ b/remote.c
@@ -1166,7 +1166,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) {
@@ -1254,7 +1254,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);
@@ -1762,7 +1762,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))
@@ -1811,8 +1811,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]);
@@ -2508,7 +2509,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;
@@ -2665,7 +2666,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;
}