summaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2018-02-15 23:18:11 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-02-15 23:18:11 (GMT)
commite17cec27d18c730dae738684d2f5df1dbd54a804 (patch)
tree3207a54751b246c7b3ecd71c9858cf6ac0bffda0 /builtin
parent04afcc2201ddb399031484eb9769393bade2529d (diff)
parent6fcec2f9aeeac6329ecf2f7084173f5b4346588b (diff)
downloadgit-e17cec27d18c730dae738684d2f5df1dbd54a804.zip
git-e17cec27d18c730dae738684d2f5df1dbd54a804.tar.gz
git-e17cec27d18c730dae738684d2f5df1dbd54a804.tar.bz2
Merge branch 'rs/lose-leak-pending' into maint
API clean-up around revision traversal. * rs/lose-leak-pending: commit: remove unused function clear_commit_marks_for_object_array() revision: remove the unused flag leak_pending checkout: avoid using the rev_info flag leak_pending bundle: avoid using the rev_info flag leak_pending bisect: avoid using the rev_info flag leak_pending object: add clear_commit_marks_all() ref-filter: use clear_commit_marks_many() in do_merge_filter() commit: use clear_commit_marks_many() in remove_redundant() commit: avoid allocation in clear_commit_marks_many()
Diffstat (limited to 'builtin')
-rw-r--r--builtin/checkout.c13
1 files changed, 1 insertions, 12 deletions
diff --git a/builtin/checkout.c b/builtin/checkout.c
index 8bdc927..c54c78d 100644
--- a/builtin/checkout.c
+++ b/builtin/checkout.c
@@ -791,7 +791,6 @@ static void orphaned_commit_warning(struct commit *old, struct commit *new)
{
struct rev_info revs;
struct object *object = &old->object;
- struct object_array refs;
init_revisions(&revs, NULL);
setup_revisions(0, NULL, &revs, NULL);
@@ -802,14 +801,6 @@ static void orphaned_commit_warning(struct commit *old, struct commit *new)
for_each_ref(add_pending_uninteresting_ref, &revs);
add_pending_oid(&revs, "HEAD", &new->object.oid, UNINTERESTING);
- /* 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))
die(_("internal error in revision walk"));
if (!(old->object.flags & UNINTERESTING))
@@ -818,9 +809,7 @@ static void orphaned_commit_warning(struct commit *old, struct commit *new)
describe_detached_head(_("Previous HEAD position was"), old);
/* Clean up objects used, as they will be reused. */
- clear_commit_marks_for_object_array(&refs, ALL_REV_FLAGS);
-
- object_array_clear(&refs);
+ clear_commit_marks_all(ALL_REV_FLAGS);
}
static int switch_branches(const struct checkout_opts *opts,