From: Rafael Silva Date: Wed, 27 Jan 2021 08:03:07 +0000 (+0100) Subject: t2402: ensure locked worktree is properly cleaned up X-Git-Tag: v2.31.0-rc0~64^2~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=47409e75f5ce85d356e5faf77e13d395137eaa46;p=thirdparty%2Fgit.git t2402: ensure locked worktree is properly cleaned up c57b3367be (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 Signed-off-by: Rafael Silva Reviewed-by: Eric Sunshine Signed-off-by: Junio C Hamano --- diff --git a/t/t2402-worktree-list.sh b/t/t2402-worktree-list.sh index 795ddca2e4..1866ea09f6 100755 --- a/t/t2402-worktree-list.sh +++ b/t/t2402-worktree-list.sh @@ -66,6 +66,7 @@ test_expect_success '"list" all worktrees with locked annotation' ' git worktree add --detach locked master && git worktree add --detach unlocked master && git worktree lock locked && + test_when_finished "git worktree unlock locked" && git worktree list >out && grep "/locked *[0-9a-f].* locked$" out && ! grep "/unlocked *[0-9a-f].* locked$" out