diff options
author | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2017-08-23 19:36:59 +0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-08-24 14:56:43 -0700 |
commit | d0c39a49ccb5dfe7feba4325c3374d99ab123c59 (patch) | |
tree | 26324606aadeab067d1d983de881a392488fac8e /submodule.c | |
parent | 419221c1065981311b1a0f4a469d4d8a9ea09f54 (diff) | |
download | git-d0c39a49ccb5dfe7feba4325c3374d99ab123c59.tar.gz |
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 'submodule.c')
-rw-r--r-- | submodule.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/submodule.c b/submodule.c index 98e1f9d3c7..61a38adcd4 100644 --- a/submodule.c +++ b/submodule.c @@ -1685,6 +1685,8 @@ static int find_first_merges(struct object_array *result, const char *path, oid_to_hex(&a->object.oid)); init_revisions(&revs, NULL); rev_opts.submodule = path; + /* FIXME: can't handle linked worktrees in submodules yet */ + revs.single_worktree = path != NULL; setup_revisions(ARRAY_SIZE(rev_args)-1, rev_args, &revs, &rev_opts); /* save all revisions from the above list that contain b */ |