Skip to content

Commit 47409e7

Browse files
raffsgitster
authored andcommitted
t2402: ensure locked worktree is properly cleaned up
c57b336 (worktree: teach `list` to annotate locked worktree, 2020-10-11) introduced a new test to ensure locked worktrees are listed with "locked" annotation. However, the test does not clean up after itself as "git worktree prune" is not going to remove the locked worktree in the first place. This not only leaves the test in an unclean state it also potentially breaks following tests that rely on the "git worktree list" output. Let's fix that by unlocking the worktree before the "prune" command. Helped-by: Eric Sunshine <[email protected]> Signed-off-by: Rafael Silva <[email protected]> Reviewed-by: Eric Sunshine <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent eb36135 commit 47409e7

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

t/t2402-worktree-list.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ test_expect_success '"list" all worktrees with locked annotation' '
6666
git worktree add --detach locked master &&
6767
git worktree add --detach unlocked master &&
6868
git worktree lock locked &&
69+
test_when_finished "git worktree unlock locked" &&
6970
git worktree list >out &&
7071
grep "/locked *[0-9a-f].* locked$" out &&
7172
! grep "/unlocked *[0-9a-f].* locked$" out

0 commit comments

Comments
 (0)