summaryrefslogtreecommitdiff
path: root/t/t2026-worktree-prune.sh
AgeCommit message (Collapse)AuthorFilesLines
2018-03-15worktree prune: improve prune logic when worktree is movedLibravatar Nguyễn Thái Ngọc Duy1-4/+3
Automatic detection of worktree relocation by a user (via 'mv', for instance) was removed by 618244e160 (worktree: stop supporting moving worktrees manually - 2016-01-22). Prior to that, .git/worktrees/<tag>/gitdir was updated whenever the worktree was accessed in order to let the pruning logic know that the worktree was "active" even if it disappeared for a while (due to being located on removable media, for instance). "git worktree move" has come so we don't really need this, but since it's easy to do, perhaps we could keep supporting manual worktree move a bit longer. Notice that when a worktree is active, the "index" file should be updated pretty often in common case. The logic is updated to check for index mtime to see if the worktree is alive. The old logic of checking gitdir's mtime is dropped because nobody updates it anyway. The new corner case is, if the index file does not exist, we immediately remove the stale worktree. But if the "index" file does not exist, you may have a bigger problem. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-10-07t2026: rename worktree prune testLibravatar Michael J Gruber1-0/+96
Linked checkouts are known under the name worktree, now. Rename the test accordingly. Specifically, this avoids the confusion that t2026 is actually not about pruning in or with linked checkouts aka worktress but about pruning worktrees, i.e. about "git worktree prune" rather than "git prune". Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>