(CommandList
  children: [
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:test_description)
          op: Equal
          rhs: {(SQ <'test worktree writing operations when skip-worktree is used'>)}
          spids: [13]
        )
      ]
      spids: [13]
    )
    (C {(.)} {(./test-lib.sh)})
    (C {(test_expect_success)} {(SQ <setup>)} 
      {
        (SQ <'\n'> <'\ttest_commit init &&\n'> <'\techo modified >> init.t &&\n'> <'\ttouch added &&\n'> 
          <'\tgit add init.t added &&\n'> <'\tgit commit -m "modified and added" &&\n'> <'\tgit tag top\n'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'read-tree updates worktree, absent case'>)} 
      {
        (SQ <'\n'> <'\tgit checkout -f top &&\n'> <'\tgit update-index --skip-worktree init.t &&\n'> 
          <'\trm init.t &&\n'> <'\tgit read-tree -m -u HEAD^ &&\n'> <'\techo init > expected &&\n'> <'\ttest_cmp expected init.t\n'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'read-tree updates worktree, dirty case'>)} 
      {
        (SQ <'\n'> <'\tgit checkout -f top &&\n'> <'\tgit update-index --skip-worktree init.t &&\n'> 
          <'\techo dirty >> init.t &&\n'> <'\ttest_must_fail git read-tree -m -u HEAD^ &&\n'> <'\tgrep -q dirty init.t &&\n'> 
          <'\ttest "$(git ls-files -t init.t)" = "S init.t" &&\n'> <'\tgit update-index --no-skip-worktree init.t\n'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'read-tree removes worktree, absent case'>)} 
      {
        (SQ <'\n'> <'\tgit checkout -f top &&\n'> <'\tgit update-index --skip-worktree added &&\n'> 
          <'\trm added &&\n'> <'\tgit read-tree -m -u HEAD^ &&\n'> <'\ttest ! -f added\n'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'read-tree removes worktree, dirty case'>)} 
      {
        (SQ <'\n'> <'\tgit checkout -f top &&\n'> <'\tgit update-index --skip-worktree added &&\n'> 
          <'\techo dirty >> added &&\n'> <'\ttest_must_fail git read-tree -m -u HEAD^ &&\n'> <'\tgrep -q dirty added &&\n'> 
          <'\ttest "$(git ls-files -t added)" = "S added" &&\n'> <'\tgit update-index --no-skip-worktree added\n'>
        )
      }
    )
    (FuncDef
      name: setup_absent
      body: 
        (BraceGroup
          children: [
            (AndOr children:[(C {(test)} {(-f)} {(1)}) (C {(rm)} {(1)})] op_id:Op_DAmp)
            (AndOr
              children: [
                (C {(git)} {(update-index)} {(--remove)} {(1)})
                (AndOr
                  children: [
                    (C {(git)} {(update-index)} {(--add)} {(--cacheinfo)} {(100644)} 
                      {($ VSub_Name '$EMPTY_BLOB')} {(1)}
                    )
                    (C {(git)} {(update-index)} {(--skip-worktree)} {(1)})
                  ]
                  op_id: Op_DAmp
                )
              ]
              op_id: Op_DAmp
            )
          ]
          spids: [114]
        )
      spids: [110 113]
    )
    (FuncDef
      name: test_absent
      body: 
        (BraceGroup
          children: [
            (AndOr
              children: [
                (SimpleCommand
                  words: [{(echo)} {(DQ ('100644 ') ($ VSub_Name '$EMPTY_BLOB') (' 0\t1'))}]
                  redirects: [(Redir op_id:Redir_Great fd:16777215 arg_word:{(expected)} spids:[184])]
                )
                (AndOr
                  children: [
                    (SimpleCommand
                      words: [{(git)} {(ls-files)} {(--stage)} {(1)}]
                      redirects: [
                        (Redir
                          op_id: Redir_Great
                          fd: 16777215
                          arg_word: {(result)}
                          spids: [199]
                        )
                      ]
                    )
                    (AndOr
                      children: [
                        (C {(test_cmp)} {(expected)} {(result)})
                        (C {(test)} {(KW_Bang '!')} {(-f)} {(1)})
                      ]
                      op_id: Op_DAmp
                    )
                  ]
                  op_id: Op_DAmp
                )
              ]
              op_id: Op_DAmp
            )
          ]
          spids: [173]
        )
      spids: [169 172]
    )
    (FuncDef
      name: setup_dirty
      body: 
        (BraceGroup
          children: [
            (AndOr
              children: [
                (C {(git)} {(update-index)} {(--force-remove)} {(1)})
                (AndOr
                  children: [
                    (SimpleCommand
                      words: [{(echo)} {(dirty)}]
                      redirects: [(Redir op_id:Redir_Great fd:16777215 arg_word:{(1)} spids:[248])]
                    )
                    (AndOr
                      children: [
                        (C {(git)} {(update-index)} {(--add)} {(--cacheinfo)} {(100644)} 
                          {($ VSub_Name '$EMPTY_BLOB')} {(1)}
                        )
                        (C {(git)} {(update-index)} {(--skip-worktree)} {(1)})
                      ]
                      op_id: Op_DAmp
                    )
                  ]
                  op_id: Op_DAmp
                )
              ]
              op_id: Op_DAmp
            )
          ]
          spids: [230]
        )
      spids: [226 229]
    )
    (FuncDef
      name: test_dirty
      body: 
        (BraceGroup
          children: [
            (AndOr
              children: [
                (SimpleCommand
                  words: [{(echo)} {(DQ ('100644 ') ($ VSub_Name '$EMPTY_BLOB') (' 0\t1'))}]
                  redirects: [(Redir op_id:Redir_Great fd:16777215 arg_word:{(expected)} spids:[298])]
                )
                (AndOr
                  children: [
                    (SimpleCommand
                      words: [{(git)} {(ls-files)} {(--stage)} {(1)}]
                      redirects: [
                        (Redir
                          op_id: Redir_Great
                          fd: 16777215
                          arg_word: {(result)}
                          spids: [313]
                        )
                      ]
                    )
                    (AndOr
                      children: [
                        (C {(test_cmp)} {(expected)} {(result)})
                        (SimpleCommand
                          words: [{(echo)} {(dirty)}]
                          redirects: [
                            (Redir
                              op_id: Redir_Great
                              fd: 16777215
                              arg_word: {(expected)}
                              spids: [333]
                            )
                          ]
                        )
                      ]
                      op_id: Op_DAmp
                    )
                  ]
                  op_id: Op_DAmp
                )
              ]
              op_id: Op_DAmp
            )
            (C {(test_cmp)} {(expected)} {(1)})
          ]
          spids: [287]
        )
      spids: [283 286]
    )
    (SimpleCommand
      words: [{(cat)}]
      redirects: [
        (Redir op_id:Redir_Great fd:16777215 arg_word:{(expected)} spids:[349])
        (HereDoc
          op_id: Redir_DLess
          fd: 16777215
          body: {(DQ ('S 1\n') ('H 2\n') ('H init.t\n') ('S sub/1\n') ('H sub/2\n'))}
          do_expansion: True
          here_end: EOF
          was_filled: True
          spids: [352]
        )
      ]
    )
    (C {(test_expect_success)} {(SQ <'index setup'>)} 
      {
        (SQ <'\n'> <'\tgit checkout -f init &&\n'> <'\tmkdir sub &&\n'> 
          <'\ttouch ./1 ./2 sub/1 sub/2 &&\n'> <'\tgit add 1 2 sub/1 sub/2 &&\n'> <'\tgit update-index --skip-worktree 1 sub/1 &&\n'> 
          <'\tgit ls-files -t > result &&\n'> <'\ttest_cmp expected result\n'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'git-add ignores worktree content'>)} 
      {(SQ <'\n'> <'\tsetup_absent &&\n'> <'\tgit add 1 &&\n'> <'\ttest_absent\n'>)}
    )
    (C {(test_expect_success)} {(SQ <'git-add ignores worktree content'>)} 
      {(SQ <'\n'> <'\tsetup_dirty &&\n'> <'\tgit add 1 &&\n'> <'\ttest_dirty\n'>)}
    )
    (C {(test_expect_success)} {(SQ <'git-rm fails if worktree is dirty'>)} 
      {(SQ <'\n'> <'\tsetup_dirty &&\n'> <'\ttest_must_fail git rm 1 &&\n'> <'\ttest_dirty\n'>)}
    )
    (SimpleCommand
      words: [{(cat)}]
      redirects: [
        (Redir op_id:Redir_Great fd:16777215 arg_word:{(expected)} spids:[424])
        (HereDoc
          op_id: Redir_DLess
          fd: 16777215
          body: {(DQ ('Would remove expected\n') ('Would remove result\n'))}
          do_expansion: True
          here_end: EOF
          was_filled: True
          spids: [427]
        )
      ]
    )
    (C {(test_expect_success)} {(SQ <'git-clean, absent case'>)} 
      {
        (SQ <'\n'> <'\tsetup_absent &&\n'> <'\tgit clean -n > result &&\n'> 
          <'\ttest_i18ncmp expected result\n'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'git-clean, dirty case'>)} 
      {
        (SQ <'\n'> <'\tsetup_dirty &&\n'> <'\tgit clean -n > result &&\n'> 
          <'\ttest_i18ncmp expected result\n'>
        )
      }
    )
    (C {(test_done)})
  ]
)