diff options
author | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2017-08-23 14:36:52 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-08-24 23:44:41 +0200 |
commit | be489d02d2f95b34e8f0fd15b9ec4752a11edd4c (patch) | |
tree | 8453a4f7809bfcc5fd6fe96f753b30bb07a88fa1 /t | |
parent | revision.c: refactor add_index_objects_to_pending() (diff) | |
download | git-be489d02d2f95b34e8f0fd15b9ec4752a11edd4c.tar.xz git-be489d02d2f95b34e8f0fd15b9ec4752a11edd4c.zip |
revision.c: --indexed-objects add objects from all worktrees
This is the result of single_worktree flag never being set (no way to up
until now). To get objects from current index only, set single_worktree.
The other add_index_objects_to_pending's caller is mark_reachable_objects()
(e.g. "git prune") which also mark objects from all indexes.
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 't')
-rwxr-xr-x | t/t5304-prune.sh | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/t/t5304-prune.sh b/t/t5304-prune.sh index 133b5842b1..cba45c7be9 100755 --- a/t/t5304-prune.sh +++ b/t/t5304-prune.sh @@ -283,4 +283,13 @@ test_expect_success 'prune: handle alternate object database' ' git -C B prune ' +test_expect_success 'prune: handle index in multiple worktrees' ' + git worktree add second-worktree && + echo "new blob for second-worktree" >second-worktree/blob && + git -C second-worktree add blob && + git prune --expire=now && + git -C second-worktree show :blob >actual && + test_cmp second-worktree/blob actual +' + test_done |