aboutsummaryrefslogtreecommitdiff
path: root/submodule.c
diff options
context:
space:
mode:
authorHeiko Voigt <hvoigt@hvoigt.net>2012-03-29 09:21:21 +0200
committerJunio C Hamano <gitster@pobox.com>2012-03-30 08:57:49 -0700
commitbcc0a3ea38a42a64878e11c5244ef2fcc967e05d (patch)
tree5ca0d025050a6b81fce75af772de37715a7c7ed2 /submodule.c
parent6f5e880c68099b185e60b2492c75e506e16d8292 (diff)
downloadgit-bcc0a3ea38a42a64878e11c5244ef2fcc967e05d.tar.gz
git-bcc0a3ea38a42a64878e11c5244ef2fcc967e05d.tar.xz
Teach revision walking machinery to walk multiple times sequencially
Previously it was not possible to iterate revisions twice using the revision walking api. We add a reset_revision_walk() which clears the used flags. This allows us to do multiple sequencial revision walks. We add the appropriate calls to the existing submodule machinery doing revision walks. This is done to avoid surprises if future code wants to call these functions more than once during the processes lifetime. Signed-off-by: Heiko Voigt <hvoigt@hvoigt.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'submodule.c')
-rw-r--r--submodule.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/submodule.c b/submodule.c
index 9a2806067..645ff5db0 100644
--- a/submodule.c
+++ b/submodule.c
@@ -404,6 +404,7 @@ int check_submodule_needs_pushing(unsigned char new_sha1[20], const char *remote
while ((commit = get_revision(&rev)) && !needs_pushing)
commit_need_pushing(commit, &needs_pushing);
+ reset_revision_walk();
free(sha1_copy);
strbuf_release(&remotes_arg);
@@ -741,6 +742,7 @@ static int find_first_merges(struct object_array *result, const char *path,
if (in_merge_bases(b, &commit, 1))
add_object_array(o, NULL, &merges);
}
+ reset_revision_walk();
/* Now we've got all merges that contain a and b. Prune all
* merges that contain another found merge and save them in