diff options
author | René Scharfe <rene.scharfe@lsrfire.ath.cx> | 2011-10-01 18:16:08 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2011-10-03 11:15:34 -0700 |
commit | 86a0a408b900eecc9d0d4a1eb8ae223181e96679 (patch) | |
tree | eb8bb329861f3d6a9868025551f30c835b1b99f0 /builtin | |
parent | 1062141928aaa1d272be8ce007d371168e8daef6 (diff) | |
download | git-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 'builtin')
-rw-r--r-- | builtin/checkout.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/builtin/checkout.c b/builtin/checkout.c index 2e8402fe0..cefa51d51 100644 --- a/builtin/checkout.c +++ b/builtin/checkout.c @@ -663,7 +663,6 @@ static void orphaned_commit_warning(struct commit *commit) struct rev_info revs; struct object *object = &commit->object; struct object_array refs; - unsigned int i; init_revisions(&revs, NULL); setup_revisions(0, NULL, &revs, NULL); @@ -683,12 +682,7 @@ static void orphaned_commit_warning(struct commit *commit) else describe_detached_head(_("Previous HEAD position was"), commit); - for (i = 0; i < refs.nr; i++) { - struct object *o = refs.objects[i].item; - struct commit *c = lookup_commit_reference_gently(o->sha1, 1); - if (c) - clear_commit_marks(c, ALL_REV_FLAGS); - } + clear_commit_marks_for_object_array(&refs, ALL_REV_FLAGS); free(refs.objects); } |