worktree: disallow adding same path multiple times
[gitweb.git] / t / t2025-worktree-add.sh
index 07d292317cdfcbca784a19c6c8f130d09c98fe98..67fccc6591da4397d8880c1dc3cc3af13c639357 100755 (executable)
@@ -552,4 +552,11 @@ test_expect_success '"add" in bare repo invokes post-checkout hook' '
        test_cmp hook.expect goozy/hook.actual
 '
 
+test_expect_success '"add" an existing but missing worktree' '
+       git worktree add --detach pneu &&
+       test_must_fail git worktree add --detach pneu &&
+       rm -fr pneu &&
+       test_must_fail git worktree add --detach pneu
+'
+
 test_done