aboutsummaryrefslogtreecommitdiff
path: root/bisect.c
diff options
context:
space:
mode:
authorRené Scharfe <rene.scharfe@lsrfire.ath.cx>2011-10-01 18:16:08 +0200
committerJunio C Hamano <gitster@pobox.com>2011-10-03 11:15:34 -0700
commit86a0a408b900eecc9d0d4a1eb8ae223181e96679 (patch)
treeeb8bb329861f3d6a9868025551f30c835b1b99f0 /bisect.c
parent1062141928aaa1d272be8ce007d371168e8daef6 (diff)
downloadgit-86a0a408b900eecc9d0d4a1eb8ae223181e96679.tar.gz
git-86a0a408b900eecc9d0d4a1eb8ae223181e96679.tar.xz
commit: factor out clear_commit_marks_for_object_array
Factor out the code to clear the commit marks for a whole struct object_array from builtin/checkout.c into its own exported function clear_commit_marks_for_object_array and use it in bisect and bundle as well. It handles tags and commits and ignores objects of any other type. Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'bisect.c')
-rw-r--r--bisect.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/bisect.c b/bisect.c
index 63cf166a6..54674fc24 100644
--- a/bisect.c
+++ b/bisect.c
@@ -818,7 +818,7 @@ static int check_ancestors(const char *prefix)
{
struct rev_info revs;
struct object_array pending_copy;
- int i, res;
+ int res;
bisect_rev_setup(&revs, prefix, "^%s", "%s", 0);
@@ -835,10 +835,7 @@ static int check_ancestors(const char *prefix)
res = (revs.commits != NULL);
/* Clean up objects used, as they will be reused. */
- for (i = 0; i < pending_copy.nr; i++) {
- struct object *o = pending_copy.objects[i].item;
- clear_commit_marks((struct commit *)o, ALL_REV_FLAGS);
- }
+ clear_commit_marks_for_object_array(&pending_copy, ALL_REV_FLAGS);
free(pending_copy.objects);
return res;