diff options
author | Junio C Hamano <gitster@pobox.com> | 2018-01-24 00:16:36 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-01-24 00:16:36 +0300 |
commit | 0bbab7d2ab61b6aad217706e0879db561e1bdfae (patch) | |
tree | 63ab2b5c82ce25fcccb8ef3e0a451d87a47a33bf /builtin | |
parent | a713fb59e701065efefb82cc862a889d96d6a9c6 (diff) | |
parent | 6fcec2f9aeeac6329ecf2f7084173f5b4346588b (diff) |
Merge branch 'rs/lose-leak-pending'
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.c | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/builtin/checkout.c b/builtin/checkout.c index 8bdc927d3f..c54c78df54 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, |