summaryrefslogtreecommitdiff
path: root/transport.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2019-10-08 04:18:24 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-10-08 04:20:01 (GMT)
commit360c7ba3305ba66bd2f38df659b6769f25be661b (patch)
treefe572df5761d90e66268fe982700f6b018f8cfe1 /transport.c
parent25e4b8099c0ed4c2b4eeb3c8a7edce3785d9aeab (diff)
downloadgit-360c7ba3305ba66bd2f38df659b6769f25be661b.zip
git-360c7ba3305ba66bd2f38df659b6769f25be661b.tar.gz
git-360c7ba3305ba66bd2f38df659b6769f25be661b.tar.bz2
transport: push codepath can take arbitrary repository
The previous step added annotations with "the_repository" to various functions in the push codepath in the transport layer, but they all can take arbitrary repository pointer, and may be working on a repository that is not the_repository. Fix them. Signed-off-by: Josh Steadmon <steadmon@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'transport.c')
-rw-r--r--transport.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/transport.c b/transport.c
index f313f28..83379a0 100644
--- a/transport.c
+++ b/transport.c
@@ -1145,10 +1145,10 @@ int transport_push(struct repository *r,
refspec_ref_prefixes(rs, &ref_prefixes);
- trace2_region_enter("transport_push", "get_refs_list", the_repository);
+ trace2_region_enter("transport_push", "get_refs_list", r);
remote_refs = transport->vtable->get_refs_list(transport, 1,
&ref_prefixes);
- trace2_region_leave("transport_push", "get_refs_list", the_repository);
+ trace2_region_leave("transport_push", "get_refs_list", r);
argv_array_clear(&ref_prefixes);
@@ -1184,7 +1184,7 @@ int transport_push(struct repository *r,
struct ref *ref = remote_refs;
struct oid_array commits = OID_ARRAY_INIT;
- trace2_region_enter("transport_push", "push_submodules", the_repository);
+ trace2_region_enter("transport_push", "push_submodules", r);
for (; ref; ref = ref->next)
if (!is_null_oid(&ref->new_oid))
oid_array_append(&commits,
@@ -1197,11 +1197,11 @@ int transport_push(struct repository *r,
transport->push_options,
pretend)) {
oid_array_clear(&commits);
- trace2_region_leave("transport_push", "push_submodules", the_repository);
+ trace2_region_leave("transport_push", "push_submodules", r);
die(_("failed to push all needed submodules"));
}
oid_array_clear(&commits);
- trace2_region_leave("transport_push", "push_submodules", the_repository);
+ trace2_region_leave("transport_push", "push_submodules", r);
}
if (((flags & TRANSPORT_RECURSE_SUBMODULES_CHECK) ||
@@ -1212,7 +1212,7 @@ int transport_push(struct repository *r,
struct string_list needs_pushing = STRING_LIST_INIT_DUP;
struct oid_array commits = OID_ARRAY_INIT;
- trace2_region_enter("transport_push", "check_submodules", the_repository);
+ trace2_region_enter("transport_push", "check_submodules", r);
for (; ref; ref = ref->next)
if (!is_null_oid(&ref->new_oid))
oid_array_append(&commits,
@@ -1223,18 +1223,18 @@ int transport_push(struct repository *r,
transport->remote->name,
&needs_pushing)) {
oid_array_clear(&commits);
- trace2_region_leave("transport_push", "check_submodules", the_repository);
+ trace2_region_leave("transport_push", "check_submodules", r);
die_with_unpushed_submodules(&needs_pushing);
}
string_list_clear(&needs_pushing, 0);
oid_array_clear(&commits);
- trace2_region_leave("transport_push", "check_submodules", the_repository);
+ trace2_region_leave("transport_push", "check_submodules", r);
}
if (!(flags & TRANSPORT_RECURSE_SUBMODULES_ONLY)) {
- trace2_region_enter("transport_push", "push_refs", the_repository);
+ trace2_region_enter("transport_push", "push_refs", r);
push_ret = transport->vtable->push_refs(transport, remote_refs, flags);
- trace2_region_leave("transport_push", "push_refs", the_repository);
+ trace2_region_leave("transport_push", "push_refs", r);
} else
push_ret = 0;
err = push_had_errors(remote_refs);