(command.CommandList
  children: [
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:test_description)
          op: assign_op.Equal
          rhs: {(SQ <'checkout can handle submodules'>)}
          spids: [4]
        )
      ]
    )
    (C {<.>} {<'./test-lib.sh'>})
    (C {<.>} {(DQ ($ Id.VSub_DollarName '$TEST_DIRECTORY')) <'/lib-submodule-update.sh'>})
    (C {<test_expect_success>} {(SQ <setup>)} 
      {
        (SQ <'\n'> <'\tmkdir submodule &&\n'> <'\t(cd submodule &&\n'> <'\t git init &&\n'> 
          <'\t test_commit first) &&\n'> <'\tgit add submodule &&\n'> <'\ttest_tick &&\n'> <'\tgit commit -m superproject &&\n'> 
          <'\t(cd submodule &&\n'> <'\t test_commit second) &&\n'> <'\tgit add submodule &&\n'> <'\ttest_tick &&\n'> 
          <'\tgit commit -m updated.superproject\n'>
        )
      }
    )
    (C {<test_expect_success>} {(SQ <'"reset <submodule>" updates the index'>)} 
      {
        (SQ <'\n'> <'\tgit update-index --refresh &&\n'> <'\tgit diff-files --quiet &&\n'> 
          <'\tgit diff-index --quiet --cached HEAD &&\n'> <'\tgit reset HEAD^ submodule &&\n'> <'\ttest_must_fail git diff-files --quiet &&\n'> 
          <'\tgit reset submodule &&\n'> <'\tgit diff-files --quiet\n'>
        )
      }
    )
    (C {<test_expect_success>} {(SQ <'"checkout <submodule>" updates the index only'>)} 
      {
        (SQ <'\n'> <'\tgit update-index --refresh &&\n'> <'\tgit diff-files --quiet &&\n'> 
          <'\tgit diff-index --quiet --cached HEAD &&\n'> <'\tgit checkout HEAD^ submodule &&\n'> <'\ttest_must_fail git diff-files --quiet &&\n'> 
          <'\tgit checkout HEAD submodule &&\n'> <'\tgit diff-files --quiet\n'>
        )
      }
    )
    (C {<test_expect_success>} {(SQ <'"checkout <submodule>" honors diff.ignoreSubmodules'>)} 
      {
        (SQ <'\n'> <'\tgit config diff.ignoreSubmodules dirty &&\n'> 
          <'\techo x> submodule/untracked &&\n'> <'\tgit checkout HEAD >actual 2>&1 &&\n'> <'\t! test -s actual\n'>
        )
      }
    )
    (C {<test_expect_success>} 
      {(SQ <'"checkout <submodule>" honors submodule.*.ignore from .gitmodules'>)} 
      {
        (SQ <'\n'> <'\tgit config diff.ignoreSubmodules none &&\n'> 
          <'\tgit config -f .gitmodules submodule.submodule.path submodule &&\n'> <'\tgit config -f .gitmodules submodule.submodule.ignore untracked &&\n'> 
          <'\tgit checkout HEAD >actual 2>&1 &&\n'> <'\t! test -s actual\n'>
        )
      }
    )
    (C {<test_expect_success>} 
      {(SQ <'"checkout <submodule>" honors submodule.*.ignore from .git/config'>)} 
      {
        (SQ <'\n'> <'\tgit config -f .gitmodules submodule.submodule.ignore none &&\n'> 
          <'\tgit config submodule.submodule.path submodule &&\n'> <'\tgit config submodule.submodule.ignore all &&\n'> <'\tgit checkout HEAD >actual 2>&1 &&\n'> 
          <'\t! test -s actual\n'>
        )
      }
    )
    (C {<test_submodule_switch>} {(DQ <'git checkout'>)})
    (C {<test_submodule_forced_switch>} {(DQ <'git checkout -f'>)})
    (C {<test_done>})
  ]
)