summaryrefslogtreecommitdiff
path: root/t/t5304-prune.sh
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2017-08-23 12:36:52 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-08-24 21:44:41 (GMT)
commitbe489d02d2f95b34e8f0fd15b9ec4752a11edd4c (patch)
tree8453a4f7809bfcc5fd6fe96f753b30bb07a88fa1 /t/t5304-prune.sh
parent6c3d818154eb74a4d5b35e786eefd297745bae1a (diff)
downloadgit-be489d02d2f95b34e8f0fd15b9ec4752a11edd4c.zip
git-be489d02d2f95b34e8f0fd15b9ec4752a11edd4c.tar.gz
git-be489d02d2f95b34e8f0fd15b9ec4752a11edd4c.tar.bz2
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/t5304-prune.sh')
-rwxr-xr-xt/t5304-prune.sh9
1 files changed, 9 insertions, 0 deletions
diff --git a/t/t5304-prune.sh b/t/t5304-prune.sh
index 133b584..cba45c7 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