summaryrefslogtreecommitdiff
path: root/bundle.c
diff options
context:
space:
mode:
authorRené Scharfe <l.s.r@web.de>2017-12-16 13:12:16 +0100
committerJunio C Hamano <gitster@pobox.com>2017-12-19 10:35:00 -0800
commit01f9c59ae6f3ab25bbe13c47d3081394ebeeb89d (patch)
tree108e9b93469fb3958f3ef784f54436e224d48ea0 /bundle.c
parent3013dff8662eae06457fe6e5348dfe2270810ab2 (diff)
downloadgit-rs/revision-keep-pending.tar.gz
revision: introduce prepare_revision_walk_extended()rs/revision-keep-pending
prepare_revision_walk() allows callers to take ownership of the array of pending objects by setting the rev_info flag "leak_pending" and copying the object_array "pending". They use it to clear commit marks after setup is done. This interface is brittle enough that it requires extensive comments. Provide an easier way by adding a function that can hand over the array to a caller-supplied output parameter and converting all users of the flag "leak_pending" to call prepare_revision_walk_extended() instead. Signed-off-by: Rene Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'bundle.c')
-rw-r--r--bundle.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/bundle.c b/bundle.c
index c092d5d68f..ed0f70c07d 100644
--- a/bundle.c
+++ b/bundle.c
@@ -158,14 +158,7 @@ int verify_bundle(struct bundle_header *header, int verbose)
setup_revisions(2, argv, &revs, NULL);
/* Save pending objects, so they can be cleaned up later. */
- refs = revs.pending;
- revs.leak_pending = 1;
-
- /*
- * prepare_revision_walk (together with .leak_pending = 1) makes us
- * the sole owner of the list of pending objects.
- */
- if (prepare_revision_walk(&revs))
+ if (prepare_revision_walk_extended(&revs, &refs))
die(_("revision walk setup failed"));
i = req_nr;