mirror of
https://github.com/git/git.git
synced 2024-11-30 21:44:02 +08:00
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 <sunshine@sunshineco.com>
Signed-off-by: Rafael Silva <rafaeloliveira.cs@gmail.com>
Reviewed-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
eb36135af7
commit
47409e75f5
@ -66,6 +66,7 @@ test_expect_success '"list" all worktrees with locked annotation' '
|
|||||||
git worktree add --detach locked master &&
|
git worktree add --detach locked master &&
|
||||||
git worktree add --detach unlocked master &&
|
git worktree add --detach unlocked master &&
|
||||||
git worktree lock locked &&
|
git worktree lock locked &&
|
||||||
|
test_when_finished "git worktree unlock locked" &&
|
||||||
git worktree list >out &&
|
git worktree list >out &&
|
||||||
grep "/locked *[0-9a-f].* locked$" out &&
|
grep "/locked *[0-9a-f].* locked$" out &&
|
||||||
! grep "/unlocked *[0-9a-f].* locked$" out
|
! grep "/unlocked *[0-9a-f].* locked$" out
|
||||||
|
Loading…
Reference in New Issue
Block a user