summaryrefslogtreecommitdiffstats
path: root/reachable.c
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2017-08-23 14:36:59 +0200
committerJunio C Hamano <gitster@pobox.com>2017-08-24 23:56:43 +0200
commitd0c39a49ccb5dfe7feba4325c3374d99ab123c59 (patch)
tree26324606aadeab067d1d983de881a392488fac8e /reachable.c
parentrefs: remove dead for_each_*_submodule() (diff)
downloadgit-d0c39a49ccb5dfe7feba4325c3374d99ab123c59.tar.xz
git-d0c39a49ccb5dfe7feba4325c3374d99ab123c59.zip
revision.c: --all adds HEAD from all worktrees
Unless single_worktree is set, --all now adds HEAD from all worktrees. Since reachable.c code does not use setup_revisions(), we need to call other_head_refs_submodule() explicitly there to have the same effect on "git prune", so that we won't accidentally delete objects needed by some other HEADs. A new FIXME is added because we would need something like int refs_other_head_refs(struct ref_store *, each_ref_fn, cb_data); in addition to other_head_refs() to handle it, which might require int get_submodule_worktrees(const char *submodule, int flags); It could be a separate topic to reduce the scope of this one. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'reachable.c')
-rw-r--r--reachable.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/reachable.c b/reachable.c
index c62efbfd43..492e87b9fa 100644
--- a/reachable.c
+++ b/reachable.c
@@ -9,6 +9,7 @@
#include "cache-tree.h"
#include "progress.h"
#include "list-objects.h"
+#include "worktree.h"
struct connectivity_progress {
struct progress *progress;
@@ -176,6 +177,7 @@ void mark_reachable_objects(struct rev_info *revs, int mark_reflog,
/* detached HEAD is not included in the list above */
head_ref(add_one_ref, revs);
+ other_head_refs(add_one_ref, revs);
/* Add all reflog info */
if (mark_reflog)