path: root/worktree.h
diff options
authorNguyễn Thái Ngọc Duy <>2017-08-23 12:36:59 (GMT)
committerJunio C Hamano <>2017-08-24 21:56:43 (GMT)
commitd0c39a49ccb5dfe7feba4325c3374d99ab123c59 (patch)
tree26324606aadeab067d1d983de881a392488fac8e /worktree.h
parent419221c1065981311b1a0f4a469d4d8a9ea09f54 (diff)
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 <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 'worktree.h')
1 files changed, 8 insertions, 0 deletions
diff --git a/worktree.h b/worktree.h
index 5ea5e50..9276c81 100644
--- a/worktree.h
+++ b/worktree.h
@@ -1,6 +1,8 @@
#ifndef WORKTREE_H
#define WORKTREE_H
+#include "refs.h"
struct worktree {
char *path;
char *id;
@@ -70,6 +72,12 @@ extern void free_worktrees(struct worktree **);
extern const struct worktree *find_shared_symref(const char *symref,
const char *target);
+ * Similar to head_ref() for all HEADs _except_ one from the current
+ * worktree, which is covered by head_ref().
+ */
+int other_head_refs(each_ref_fn fn, void *cb_data);
int is_worktree_being_rebased(const struct worktree *wt, const char *target);
int is_worktree_being_bisected(const struct worktree *wt, const char *target);