(command.CommandList
  children: [
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:test_description)
          op: assign_op.Equal
          rhs: {(SQ <'Try various core-level commands in subdirectory.\n'>)}
          spids: [13]
        )
      ]
    )
    (C {<.>} {<'./test-lib.sh'>})
    (C {<.>} {(DQ ($ Id.VSub_DollarName '$TEST_DIRECTORY')) <'/lib-read-tree.sh'>})
    (C {<test_expect_success>} {<setup>} 
      {
        (SQ <'\n'> <'\tlong="a b c d e f g h i j k l m n o p q r s t u v w x y z" &&\n'> 
          <'\tfor c in $long; do echo $c; done >one &&\n'> <'\tmkdir dir &&\n'> <'\tfor c in x y z $long a b c; do echo $c; done >dir/two &&\n'> 
          <'\tcp one original.one &&\n'> <'\tcp dir/two original.two\n'>
        )
      }
    )
    (C {<test_expect_success>} {(SQ <'update-index and ls-files'>)} 
      {
        (SQ <'\n'> <'\tgit update-index --add one &&\n'> <'\tcase "$(git ls-files)" in\n'> 
          <'\tone) echo pass one ;;\n'> <'\t*) echo bad one; exit 1 ;;\n'> <'\tesac &&\n'> <'\t(\n'> <'\t\tcd dir &&\n'> 
          <'\t\tgit update-index --add two &&\n'> <'\t\tcase "$(git ls-files)" in\n'> <'\t\ttwo) echo pass two ;;\n'> 
          <'\t\t*) echo bad two; exit 1 ;;\n'> <'\t\tesac\n'> <'\t) &&\n'> <'\tcase "$(git ls-files)" in\n'> <'\tdir/two"$LF"one) echo pass both ;;\n'> 
          <'\t*) echo bad; exit 1 ;;\n'> <'\tesac\n'>
        )
      }
    )
    (C {<test_expect_success>} {(SQ <cat-file>)} 
      {
        (SQ <'\n'> <'\ttwo=$(git ls-files -s dir/two) &&\n'> 
          <'\ttwo=$(expr "$two" : "[0-7]* \\\\([0-9a-f]*\\\\)") &&\n'> <'\techo "$two" &&\n'> <'\tgit cat-file -p "$two" >actual &&\n'> <'\tcmp dir/two actual &&\n'> <'\t(\n'> 
          <'\t\tcd dir &&\n'> <'\t\tgit cat-file -p "$two" >actual &&\n'> <'\t\tcmp two actual\n'> <'\t)\n'>
        )
      }
    )
    (C {<rm>} {<-f>} {<actual>} {<'dir/actual'>})
    (C {<test_expect_success>} {(SQ <diff-files>)} 
      {
        (SQ <'\n'> <'\techo a >>one &&\n'> <'\techo d >>dir/two &&\n'> 
          <'\tcase "$(git diff-files --name-only)" in\n'> <'\tdir/two"$LF"one) echo pass top ;;\n'> <'\t*) echo bad top; exit 1 ;;\n'> <'\tesac &&\n'> 
          <'\t# diff should not omit leading paths\n'> <'\t(\n'> <'\t\tcd dir &&\n'> <'\t\tcase "$(git diff-files --name-only)" in\n'> 
          <'\t\tdir/two"$LF"one) echo pass subdir ;;\n'> <'\t\t*) echo bad subdir; exit 1 ;;\n'> <'\t\tesac &&\n'> 
          <'\t\tcase "$(git diff-files --name-only .)" in\n'> <'\t\tdir/two) echo pass subdir limited ;;\n'> <'\t\t*) echo bad subdir limited; exit 1 ;;\n'> 
          <'\t\tesac\n'> <'\t)\n'>
        )
      }
    )
    (C {<test_expect_success>} {(SQ <write-tree>)} 
      {
        (SQ <'\n'> <'\ttop=$(git write-tree) &&\n'> <'\techo $top &&\n'> <'\t(\n'> <'\t\tcd dir &&\n'> 
          <'\t\tsub=$(git write-tree) &&\n'> <'\t\techo $sub &&\n'> <'\t\ttest "z$top" = "z$sub"\n'> <'\t)\n'>
        )
      }
    )
    (C {<test_expect_success>} {(SQ <checkout-index>)} 
      {
        (SQ <'\n'> <'\tgit checkout-index -f -u one &&\n'> <'\tcmp one original.one &&\n'> <'\t(\n'> 
          <'\t\tcd dir &&\n'> <'\t\tgit checkout-index -f -u two &&\n'> <'\t\tcmp two ../original.two\n'> <'\t)\n'>
        )
      }
    )
    (C {<test_expect_success>} {(SQ <read-tree>)} 
      {
        (SQ <'\n'> <'\trm -f one dir/two &&\n'> <'\ttree=$(git write-tree) &&\n'> 
          <'\tread_tree_u_must_succeed --reset -u "$tree" &&\n'> <'\tcmp one original.one &&\n'> <'\tcmp dir/two original.two &&\n'> <'\t(\n'> <'\t\tcd dir &&\n'> 
          <'\t\trm -f two &&\n'> <'\t\tread_tree_u_must_succeed --reset -u "$tree" &&\n'> <'\t\tcmp two ../original.two &&\n'> 
          <'\t\tcmp ../one ../original.one\n'> <'\t)\n'>
        )
      }
    )
    (C {<test_expect_success>} {(SQ <'alias expansion'>)} 
      {
        (SQ <'\n'> <'\t(\n'> <'\t\tgit config alias.test-status-alias status &&\n'> <'\t\tcd dir &&\n'> 
          <'\t\tgit status &&\n'> <'\t\tgit test-status-alias\n'> <'\t)\n'>
        )
      }
    )
    (C {<test_expect_success>} {<Id.KW_Bang '!'> <MINGW>} {(SQ <'!alias expansion'>)} 
      {
        (SQ <'\n'> <'\tpwd >expect &&\n'> <'\t(\n'> 
          <'\t\tgit config alias.test-alias-directory !pwd &&\n'> <'\t\tcd dir &&\n'> <'\t\tgit test-alias-directory >../actual\n'> <'\t) &&\n'> 
          <'\ttest_cmp expect actual\n'>
        )
      }
    )
    (C {<test_expect_success>} {(SQ <'GIT_PREFIX for !alias'>)} 
      {
        (SQ <'\n'> <'\tprintf "dir/" >expect &&\n'> <'\t(\n'> 
          <'\t\tgit config alias.test-alias-directory "!sh -c \\"printf \\$GIT_PREFIX\\"" &&\n'> <'\t\tcd dir &&\n'> <'\t\tgit test-alias-directory >../actual\n'> <'\t) &&\n'> 
          <'\ttest_cmp expect actual\n'>
        )
      }
    )
    (C {<test_expect_success>} {(SQ <'GIT_PREFIX for built-ins'>)} 
      {
        (SQ <'\n'> <'\t# Use GIT_EXTERNAL_DIFF to test that the "diff" built-in\n'> 
          <'\t# receives the GIT_PREFIX variable.\n'> <'\techo "dir/" >expect &&\n'> <'\twrite_script diff <<-\\EOF &&\n'> 
          <'\tprintf "%s\\n" "$GIT_PREFIX"\n'> <'\tEOF\n'> <'\t(\n'> <'\t\tcd dir &&\n'> <'\t\techo "change" >two &&\n'> 
          <'\t\tGIT_EXTERNAL_DIFF=./diff git diff >../actual\n'> <'\t\tgit checkout -- two\n'> <'\t) &&\n'> <'\ttest_cmp expect actual\n'>
        )
      }
    )
    (C {<test_expect_success>} {(SQ <'no file/rev ambiguity check inside .git'>)} 
      {
        (SQ <'\n'> <'\tgit commit -a -m 1 &&\n'> <'\t(\n'> <'\t\tcd .git &&\n'> 
          <'\t\tgit show -s HEAD\n'> <'\t)\n'>
        )
      }
    )
    (C {<test_expect_success>} 
      {(SQ <'no file/rev ambiguity check inside a bare repo (explicit GIT_DIR)'>)} 
      {
        (SQ <'\n'> <'\ttest_when_finished "rm -fr foo.git" &&\n'> 
          <'\tgit clone -s --bare .git foo.git &&\n'> <'\t(\n'> <'\t\tcd foo.git &&\n'> <'\t\t# older Git needed help by exporting GIT_DIR=.\n'> 
          <'\t\t# to realize that it is inside a bare repository.\n'> <'\t\t# We keep this test around for regression testing.\n'> <'\t\tGIT_DIR=. git show -s HEAD\n'> 
          <'\t)\n'>
        )
      }
    )
    (C {<test_expect_success>} {(SQ <'no file/rev ambiguity check inside a bare repo'>)} 
      {
        (SQ <'\n'> <'\ttest_when_finished "rm -fr foo.git" &&\n'> 
          <'\tgit clone -s --bare .git foo.git &&\n'> <'\t(\n'> <'\t\tcd foo.git &&\n'> <'\t\tgit show -s HEAD\n'> <'\t)\n'>
        )
      }
    )
    (C {<test_expect_success>} {<SYMLINKS>} {(SQ <'detection should not be fooled by a symlink'>)} 
      {
        (SQ <'\n'> <'\tgit clone -s .git another &&\n'> <'\tln -s another yetanother &&\n'> <'\t(\n'> 
          <'\t\tcd yetanother/.git &&\n'> <'\t\tgit show -s HEAD\n'> <'\t)\n'>
        )
      }
    )
    (C {<test_done>})
  ]
)