switch: reject if the branch is already checked out elsewhere (test)
commit894ea945095b74542c6c4f4aefbe20f5b68be437
authorRubén Justo <rjusto@gmail.com>
Sat, 25 Feb 2023 14:22:23 +0000 (25 15:22 +0100)
committerJunio C Hamano <gitster@pobox.com>
Sat, 25 Feb 2023 21:05:23 +0000 (25 13:05 -0800)
tree665026cff3efa48b4af18e4655e9bd676343f991
parent279f42fa27b4ffd0b3ac7c9378043eeb413f0f5a
switch: reject if the branch is already checked out elsewhere (test)

Since 5883034 (checkout: reject if the branch is already checked out
elsewhere) in normal use, we do not allow multiple worktrees having the
same checked out branch.

A bug has recently been fixed that caused this to not work as expected.

Let's add a test to notice if this changes in the future.

Signed-off-by: Rubén Justo <rjusto@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t2060-switch.sh