(command.CommandList
  children: [
    (command.ShAssignment
      left: <Id.Lit_VarLike 'test_description='>
      pairs: [
        (AssignPair
          left: <Id.Lit_VarLike 'test_description='>
          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'test_description='> name:test_description)
          op: assign_op.Equal
          rhs: {(SQ <'test git worktree add'>)}
        )
      ]
      redirects: []
    )
    (command.Simple
      blame_tok: <.>
      more_env: []
      words: [{<.>} {<'./test-lib.sh'>}]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <.>
      more_env: []
      words: [{<.>} {(DQ ($ Id.VSub_DollarName TEST_DIRECTORY)) <'/lib-rebase.sh'>}]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [{<test_expect_success>} {(SQ <setup>)} {(SQ <'\n'> <'\ttest_commit init\n'>)}]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'"add" an existing worktree'>)}
        {
          (SQ <'\n'> <'\tmkdir -p existing/subtree &&\n'> 
            <'\ttest_must_fail git worktree add --detach existing master\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'"add" an existing empty worktree'>)}
        {
          (SQ <'\n'> <'\tmkdir existing_empty &&\n'> 
            <'\tgit worktree add --detach existing_empty master\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'"add" using shorthand - fails when no previous branch'>)}
        {(SQ <'\n'> <'\ttest_must_fail git worktree add existing_short -\n'>)}
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'"add" using - shorthand'>)}
        {
          (SQ <'\n'> <'\tgit checkout -b newbranch &&\n'> <'\techo hello >myworld &&\n'> 
            <'\tgit add myworld &&\n'> <'\tgit commit -m myworld &&\n'> <'\tgit checkout master &&\n'> 
            <'\tgit worktree add short-hand - &&\n'> <'\techo refs/heads/newbranch >expect &&\n'> 
            <'\tgit -C short-hand rev-parse --symbolic-full-name HEAD >actual &&\n'> <'\ttest_cmp expect actual\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'"add" refuses to checkout locked branch'>)}
        {
          (SQ <'\n'> <'\ttest_must_fail git worktree add zere master &&\n'> <'\t! test -d zere &&\n'> 
            <'\t! test -d .git/worktrees/zere\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'checking out paths not complaining about linked checkouts'>)}
        {
          (SQ <'\n'> <'\t(\n'> <'\tcd existing_empty &&\n'> <'\techo dirty >>init.t &&\n'> 
            <'\tgit checkout master -- init.t\n'> <'\t)\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'"add" worktree'>)}
        {
          (SQ <'\n'> <'\tgit rev-parse HEAD >expect &&\n'> 
            <'\tgit worktree add --detach here master &&\n'> <'\t(\n'> <'\t\tcd here &&\n'> <'\t\ttest_cmp ../init.t init.t &&\n'> 
            <'\t\ttest_must_fail git symbolic-ref HEAD &&\n'> <'\t\tgit rev-parse HEAD >actual &&\n'> <'\t\ttest_cmp ../expect actual &&\n'> <'\t\tgit fsck\n'> 
            <'\t)\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'"add" worktree from a subdir'>)}
        {
          (SQ <'\n'> <'\t(\n'> <'\t\tmkdir sub &&\n'> <'\t\tcd sub &&\n'> 
            <'\t\tgit worktree add --detach here master &&\n'> <'\t\tcd here &&\n'> <'\t\ttest_cmp ../../init.t init.t\n'> <'\t)\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'"add" from a linked checkout'>)}
        {
          (SQ <'\n'> <'\t(\n'> <'\t\tcd here &&\n'> 
            <'\t\tgit worktree add --detach nested-here master &&\n'> <'\t\tcd nested-here &&\n'> <'\t\tgit fsck\n'> <'\t)\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'"add" worktree creating new branch'>)}
        {
          (SQ <'\n'> <'\tgit worktree add -b newmaster there master &&\n'> <'\t(\n'> 
            <'\t\tcd there &&\n'> <'\t\ttest_cmp ../init.t init.t &&\n'> <'\t\tgit symbolic-ref HEAD >actual &&\n'> 
            <'\t\techo refs/heads/newmaster >expect &&\n'> <'\t\ttest_cmp expect actual &&\n'> <'\t\tgit fsck\n'> <'\t)\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'die the same branch is already checked out'>)}
        {
          (SQ <'\n'> <'\t(\n'> <'\t\tcd here &&\n'> <'\t\ttest_must_fail git checkout newmaster\n'> 
            <'\t)\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {<SYMLINKS>}
        {(SQ <'die the same branch is already checked out (symlink)'>)}
        {
          (SQ <'\n'> <'\thead=$(git -C there rev-parse --git-path HEAD) &&\n'> 
            <'\tref=$(git -C there symbolic-ref HEAD) &&\n'> <'\trm "$head" &&\n'> <'\tln -s "$ref" "$head" &&\n'> 
            <'\ttest_must_fail git -C here checkout newmaster\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'not die the same branch is already checked out'>)}
        {
          (SQ <'\n'> <'\t(\n'> <'\t\tcd here &&\n'> 
            <'\t\tgit worktree add --force anothernewmaster newmaster\n'> <'\t)\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'not die on re-checking out current branch'>)}
        {(SQ <'\n'> <'\t(\n'> <'\t\tcd there &&\n'> <'\t\tgit checkout newmaster\n'> <'\t)\n'>)}
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'"add" from a bare repo'>)}
        {
          (SQ <'\n'> <'\t(\n'> <'\t\tgit clone --bare . bare &&\n'> <'\t\tcd bare &&\n'> 
            <'\t\tgit worktree add -b bare-master ../there2 master\n'> <'\t)\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'checkout from a bare repo without "add"'>)}
        {
          (SQ <'\n'> <'\t(\n'> <'\t\tcd bare &&\n'> <'\t\ttest_must_fail git checkout master\n'> 
            <'\t)\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'"add" default branch of a bare repo'>)}
        {
          (SQ <'\n'> <'\t(\n'> <'\t\tgit clone --bare . bare2 &&\n'> <'\t\tcd bare2 &&\n'> 
            <'\t\tgit worktree add ../there3 master\n'> <'\t)\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'checkout with grafts'>)}
        {
          (SQ <'\n'> <'\ttest_when_finished rm .git/info/grafts &&\n'> <'\ttest_commit abc &&\n'> 
            <'\tSHA1=$(git rev-parse HEAD) &&\n'> <'\ttest_commit def &&\n'> <'\ttest_commit xyz &&\n'> 
            <'\techo "$(git rev-parse HEAD) $SHA1" >.git/info/grafts &&\n'> <'\tcat >expected <<-\\EOF &&\n'> <'\txyz\n'> <'\tabc\n'> <'\tEOF\n'> 
            <'\tgit log --format=%s -2 >actual &&\n'> <'\ttest_cmp expected actual &&\n'> <'\tgit worktree add --detach grafted master &&\n'> 
            <'\tgit --git-dir=grafted/.git log --format=%s -2 >actual &&\n'> <'\ttest_cmp expected actual\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'"add" from relative HEAD'>)}
        {
          (SQ <'\n'> <'\ttest_commit a &&\n'> <'\ttest_commit b &&\n'> <'\ttest_commit c &&\n'> 
            <'\tgit rev-parse HEAD~1 >expected &&\n'> <'\tgit worktree add relhead HEAD~1 &&\n'> <'\tgit -C relhead rev-parse HEAD >actual &&\n'> 
            <'\ttest_cmp expected actual\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'"add -b" with <branch> omitted'>)}
        {(SQ <'\n'> <'\tgit worktree add -b burble flornk &&\n'> <'\ttest_cmp_rev HEAD burble\n'>)}
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'"add --detach" with <branch> omitted'>)}
        {
          (SQ <'\n'> <'\tgit worktree add --detach fishhook &&\n'> 
            <'\tgit rev-parse HEAD >expected &&\n'> <'\tgit -C fishhook rev-parse HEAD >actual &&\n'> <'\ttest_cmp expected actual &&\n'> 
            <'\ttest_must_fail git -C fishhook symbolic-ref HEAD\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'"add" with <branch> omitted'>)}
        {(SQ <'\n'> <'\tgit worktree add wiffle/bat &&\n'> <'\ttest_cmp_rev HEAD bat\n'>)}
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'"add" auto-vivify does not clobber existing branch'>)}
        {
          (SQ <'\n'> <'\ttest_commit c1 &&\n'> <'\ttest_commit c2 &&\n'> 
            <'\tgit branch precious HEAD~1 &&\n'> <'\ttest_must_fail git worktree add precious &&\n'> <'\ttest_cmp_rev HEAD~1 precious &&\n'> 
            <'\ttest_path_is_missing precious\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'"add" no auto-vivify with --detach and <branch> omitted'>)}
        {
          (SQ <'\n'> <'\tgit worktree add --detach mish/mash &&\n'> 
            <'\ttest_must_fail git rev-parse mash -- &&\n'> <'\ttest_must_fail git -C mish/mash symbolic-ref HEAD\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'"add" -b/-B mutually exclusive'>)}
        {(SQ <'\n'> <'\ttest_must_fail git worktree add -b poodle -B poodle bamboo master\n'>)}
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'"add" -b/--detach mutually exclusive'>)}
        {(SQ <'\n'> <'\ttest_must_fail git worktree add -b poodle --detach bamboo master\n'>)}
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'"add" -B/--detach mutually exclusive'>)}
        {(SQ <'\n'> <'\ttest_must_fail git worktree add -B poodle --detach bamboo master\n'>)}
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'"add -B" fails if the branch is checked out'>)}
        {
          (SQ <'\n'> <'\tgit rev-parse newmaster >before &&\n'> 
            <'\ttest_must_fail git worktree add -B newmaster bamboo master &&\n'> <'\tgit rev-parse newmaster >after &&\n'> <'\ttest_cmp before after\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'add -B'>)}
        {
          (SQ <'\n'> <'\tgit worktree add -B poodle bamboo2 master^ &&\n'> 
            <'\tgit -C bamboo2 symbolic-ref HEAD >actual &&\n'> <'\techo refs/heads/poodle >expected &&\n'> <'\ttest_cmp expected actual &&\n'> 
            <'\ttest_cmp_rev master^ poodle\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'local clone from linked checkout'>)}
        {
          (SQ <'\n'> <'\tgit clone --local here here-clone &&\n'> <'\t( cd here-clone && git fsck )\n'>)
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'"add" worktree with --no-checkout'>)}
        {
          (SQ <'\n'> <'\tgit worktree add --no-checkout -b swamp swamp &&\n'> 
            <'\t! test -e swamp/init.t &&\n'> <'\tgit -C swamp reset --hard &&\n'> <'\ttest_cmp init.t swamp/init.t\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'"add" worktree with --checkout'>)}
        {
          (SQ <'\n'> <'\tgit worktree add --checkout -b swmap2 swamp2 &&\n'> 
            <'\ttest_cmp init.t swamp2/init.t\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'put a worktree under rebase'>)}
        {
          (SQ <'\n'> <'\tgit worktree add under-rebase &&\n'> <'\t(\n'> <'\t\tcd under-rebase &&\n'> 
            <'\t\tset_fake_editor &&\n'> <'\t\tFAKE_LINES="edit 1" git rebase -i HEAD^ &&\n'> 
            <'\t\tgit worktree list | grep "under-rebase.*detached HEAD"\n'> <'\t)\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'add a worktree, checking out a rebased branch'>)}
        {
          (SQ <'\n'> <'\ttest_must_fail git worktree add new-rebase under-rebase &&\n'> 
            <'\t! test -d new-rebase\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'checking out a rebased branch from another worktree'>)}
        {
          (SQ <'\n'> <'\tgit worktree add new-place &&\n'> 
            <'\ttest_must_fail git -C new-place checkout under-rebase\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'not allow to delete a branch under rebase'>)}
        {
          (SQ <'\n'> <'\t(\n'> <'\t\tcd under-rebase &&\n'> 
            <'\t\ttest_must_fail git branch -D under-rebase\n'> <'\t)\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'rename a branch under rebase not allowed'>)}
        {(SQ <'\n'> <'\ttest_must_fail git branch -M under-rebase rebase-with-new-name\n'>)}
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'check out from current worktree branch ok'>)}
        {
          (SQ <'\n'> <'\t(\n'> <'\t\tcd under-rebase &&\n'> <'\t\tgit checkout under-rebase &&\n'> 
            <'\t\tgit checkout - &&\n'> <'\t\tgit rebase --abort\n'> <'\t)\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'checkout a branch under bisect'>)}
        {
          (SQ <'\n'> <'\tgit worktree add under-bisect &&\n'> <'\t(\n'> <'\t\tcd under-bisect &&\n'> 
            <'\t\tgit bisect start &&\n'> <'\t\tgit bisect bad &&\n'> <'\t\tgit bisect good HEAD~2 &&\n'> 
            <'\t\tgit worktree list | grep "under-bisect.*detached HEAD" &&\n'> <'\t\ttest_must_fail git worktree add new-bisect under-bisect &&\n'> <'\t\t! test -d new-bisect\n'> 
            <'\t)\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'rename a branch under bisect not allowed'>)}
        {(SQ <'\n'> <'\ttest_must_fail git branch -M under-bisect bisect-with-new-name\n'>)}
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_done>
      more_env: []
      words: [{<test_done>}]
      redirects: []
      do_fork: T
    )
  ]
)