This is basically a rebased version after a lot of changes in nd/files-backend-git-dir. Thanks to test-ref-store.c, I found and fixed a bug in for_each_reflog in v1 code.
This series needs latest nd/worktree-kill-parse-ref [1]. But you can get everything on my github fork, branch prune-in-worktrees-2. [1] http://public-inbox.org/git/%3c20170318100206.5980-1-pclo...@gmail.com%3E/ Nguyễn Thái Ngọc Duy (12): revision.h: new flag in struct rev_info wrt. worktree-related refs revision.c: refactor add_index_objects_to_pending() revision.c: --indexed-objects add objects from all worktrees refs.c: refactor get_submodule_ref_store(), share common free block refs: move submodule slash stripping code to get_submodule_ref_store refs: add refs_head_ref() revision.c: use refs_for_each*() instead of for_each_*_submodule() refs: remove dead for_each_*_submodule() revision.c: --all adds HEAD from all worktrees files-backend: make reflog iterator go through per-worktree reflog revision.c: --reflog add HEAD reflog from all worktrees rev-list: expose and document --single-worktree Documentation/rev-list-options.txt | 8 +++ reachable.c | 1 + refs.c | 110 +++++++++++++++---------------- refs.h | 12 +--- refs/files-backend.c | 46 +++++++++---- revision.c | 130 ++++++++++++++++++++++++++++++------- revision.h | 1 + submodule.c | 2 + t/t1407-worktree-ref-store.sh | 30 +++++++++ t/t5304-prune.sh | 37 +++++++++++ 10 files changed, 277 insertions(+), 100 deletions(-) -- 2.11.0.157.gd943d85