Revert "t/lib-git-daemon: record daemon log"
[gitweb.git] / t / t2025-worktree-add.sh
index be6e093142cdbeb18fa0ff155f3adf1e7a566ca2..286bba35d8ae06f97cbf59263cd472975036deaa 100755 (executable)
@@ -252,6 +252,11 @@ test_expect_success 'add -B' '
        test_cmp_rev master^ poodle
 '
 
+test_expect_success 'add --quiet' '
+       git worktree add --quiet another-worktree master 2>actual &&
+       test_must_be_empty actual
+'
+
 test_expect_success 'local clone from linked checkout' '
        git clone --local here here-clone &&
        ( cd here-clone && git fsck )
@@ -412,9 +417,8 @@ test_expect_success '"add" <path> <branch> dwims with checkout.defaultRemote' '
                git fetch repo_upstream2 &&
                test_must_fail git worktree add ../foo foo &&
                git -c checkout.defaultRemote=repo_upstream worktree add ../foo foo &&
-               >status.expect &&
                git status -uno --porcelain >status.actual &&
-               test_cmp status.expect status.actual
+               test_must_be_empty status.actual
        ) &&
        (
                cd foo &&
@@ -548,4 +552,22 @@ 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 &&
+       git worktree add --force --detach pneu
+'
+
+test_expect_success '"add" an existing locked but missing worktree' '
+       git worktree add --detach gnoo &&
+       git worktree lock gnoo &&
+       test_when_finished "git worktree unlock gnoo || :" &&
+       rm -fr gnoo &&
+       test_must_fail git worktree add --detach gnoo &&
+       test_must_fail git worktree add --force --detach gnoo &&
+       git worktree add --force --force --detach gnoo
+'
+
 test_done