(CommandList
  children: [
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:test_description)
          op: Equal
          rhs: 
            {
              (SQ <"git checkout-index --prefix test.\n"> <"\n"> 
                <"This test makes sure that --prefix option works as advertised, and\n"> <"also verifies that such leading path may contain symlinks, unlike\n"> 
                <"the GIT controlled paths.\n">
              )
            }
          spids: [13]
        )
      ]
      spids: [13]
    )
    (C {(.)} {(./test-lib.sh)})
    (C {(test_expect_success)} {(SQ <setup>)} 
      {
        (SQ <"\n"> <"\tmkdir path1 &&\n"> <"\techo frotz >path0 &&\n"> 
          <"\techo rezrov >path1/file1 &&\n"> <"\tgit update-index --add path0 path1/file1\n">
        )
      }
    )
    (C {(test_expect_success)} {(SYMLINKS)} {(SQ <"have symlink in place where dir is expected.">)} 
      {
        (SQ <"\n"> <"\trm -fr path0 path1 &&\n"> <"\tmkdir path2 &&\n"> <"\tln -s path2 path1 &&\n"> 
          <"\tgit checkout-index -f -a &&\n"> <"\ttest ! -h path1 && test -d path1 &&\n"> <"\ttest -f path1/file1 && test ! -f path2/file1\n">
        )
      }
    )
    (C {(test_expect_success)} {(SQ <"use --prefix=path2/">)} 
      {
        (SQ <"\n"> <"\trm -fr path0 path1 path2 &&\n"> <"\tmkdir path2 &&\n"> 
          <"\tgit checkout-index --prefix=path2/ -f -a &&\n"> <"\ttest -f path2/path0 &&\n"> <"\ttest -f path2/path1/file1 &&\n"> <"\ttest ! -f path0 &&\n"> 
          <"\ttest ! -f path1/file1\n">
        )
      }
    )
    (C {(test_expect_success)} {(SQ <"use --prefix=tmp-">)} 
      {
        (SQ <"\n"> <"\trm -fr path0 path1 path2 tmp* &&\n"> 
          <"\tgit checkout-index --prefix=tmp- -f -a &&\n"> <"\ttest -f tmp-path0 &&\n"> <"\ttest -f tmp-path1/file1 &&\n"> <"\ttest ! -f path0 &&\n"> 
          <"\ttest ! -f path1/file1\n">
        )
      }
    )
    (C {(test_expect_success)} {(SQ <"use --prefix=tmp- but with a conflicting file and dir">)} 
      {
        (SQ <"\n"> <"\trm -fr path0 path1 path2 tmp* &&\n"> <"\techo nitfol >tmp-path1 &&\n"> 
          <"\tmkdir tmp-path0 &&\n"> <"\tgit checkout-index --prefix=tmp- -f -a &&\n"> <"\ttest -f tmp-path0 &&\n"> 
          <"\ttest -f tmp-path1/file1 &&\n"> <"\ttest ! -f path0 &&\n"> <"\ttest ! -f path1/file1\n">
        )
      }
    )
    (C {(test_expect_success)} {(SYMLINKS)} {(SQ <"use --prefix=tmp/orary/ where tmp is a symlink">)} 
      {
        (SQ <"\n"> <"\trm -fr path0 path1 path2 tmp* &&\n"> <"\tmkdir tmp1 tmp1/orary &&\n"> 
          <"\tln -s tmp1 tmp &&\n"> <"\tgit checkout-index --prefix=tmp/orary/ -f -a &&\n"> <"\ttest -d tmp1/orary &&\n"> 
          <"\ttest -f tmp1/orary/path0 &&\n"> <"\ttest -f tmp1/orary/path1/file1 &&\n"> <"\ttest -h tmp\n">
        )
      }
    )
    (C {(test_expect_success)} {(SYMLINKS)} {(SQ <"use --prefix=tmp/orary- where tmp is a symlink">)} 
      {
        (SQ <"\n"> <"\trm -fr path0 path1 path2 tmp* &&\n"> <"\tmkdir tmp1 &&\n"> 
          <"\tln -s tmp1 tmp &&\n"> <"\tgit checkout-index --prefix=tmp/orary- -f -a &&\n"> <"\ttest -f tmp1/orary-path0 &&\n"> 
          <"\ttest -f tmp1/orary-path1/file1 &&\n"> <"\ttest -h tmp\n">
        )
      }
    )
    (C {(test_expect_success)} {(SYMLINKS)} {(SQ <"use --prefix=tmp- where tmp-path1 is a symlink">)} 
      {
        (SQ <"\n"> <"\trm -fr path0 path1 path2 tmp* &&\n"> <"\tmkdir tmp1 &&\n"> 
          <"\tln -s tmp1 tmp-path1 &&\n"> <"\tgit checkout-index --prefix=tmp- -f -a &&\n"> <"\ttest -f tmp-path0 &&\n"> 
          <"\ttest ! -h tmp-path1 &&\n"> <"\ttest -d tmp-path1 &&\n"> <"\ttest -f tmp-path1/file1\n">
        )
      }
    )
    (C {(test_expect_success)} {(SQ <"apply filter from working tree .gitattributes with --prefix">)} 
      {
        (SQ <"\n"> <"\trm -fr path0 path1 path2 tmp* &&\n"> <"\tmkdir path1 &&\n"> <"\tmkdir tmp &&\n"> 
          <"\tgit config filter.replace-all.smudge \"sed -e s/./,/g\" &&\n"> <"\tgit config filter.replace-all.clean cat &&\n"> 
          <"\tgit config filter.replace-all.required true &&\n"> <"\techo \"file1 filter=replace-all\" >path1/.gitattributes &&\n"> 
          <"\tgit checkout-index --prefix=tmp/ -f -a &&\n"> <"\techo frotz >expected &&\n"> <"\ttest_cmp expected tmp/path0 &&\n"> <"\techo ,,,,,, >expected &&\n"> 
          <"\ttest_cmp expected tmp/path1/file1\n">
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ <"apply CRLF filter from working tree .gitattributes with --prefix">)} 
      {
        (SQ <"\n"> <"\trm -fr path0 path1 path2 tmp* &&\n"> <"\tmkdir path1 &&\n"> <"\tmkdir tmp &&\n"> 
          <"\techo \"file1 eol=crlf\" >path1/.gitattributes &&\n"> <"\tgit checkout-index --prefix=tmp/ -f -a &&\n"> <"\techo rezrovQ >expected &&\n"> 
          <"\ttr \\\\015 Q <tmp/path1/file1 >actual &&\n"> <"\ttest_cmp expected actual\n">
        )
      }
    )
    (C {(test_done)})
  ]
)