(CommandList
  children: [
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:test_description)
          op: Equal
          rhs: 
            {
              (SQ <"Pathspec restrictions\n"> <"\n"> <"Prepare:\n"> <"        file0\n"> 
                <"        path1/file1\n">
              )
            }
          spids: [13]
        )
      ]
      spids: [13]
    )
    (C {(.)} {(./test-lib.sh)})
    (Sentence
      child: (C {(.)} {(DQ ($ VSub_Name "$TEST_DIRECTORY")) (/diff-lib.sh)})
      terminator: <Op_Semi ";">
    )
    (C {(test_expect_success)} {(setup)} 
      {
        (SQ <"echo frotz >file0 &&\n"> <"     mkdir path1 &&\n"> <"     echo rezrov >path1/file1 &&\n"> 
          <"     git update-index --add file0 path1/file1 &&\n"> <"     tree=$(git write-tree) &&\n"> <"     echo \"$tree\" &&\n"> <"     echo nitfol >file0 &&\n"> 
          <"     echo yomin >path1/file1 &&\n"> <"     git update-index file0 path1/file1">
        )
      }
    )
    (SimpleCommand
      words: [{(cat)}]
      redirects: [
        (Redir op_id:Redir_Great fd:-1 arg_word:{(expected)} spids:[61])
        (HereDoc
          op_id: Redir_DLess
          fd: -1
          body: {}
          do_expansion: False
          here_end: EOF
          was_filled: True
          spids: [64]
        )
      ]
    )
    (C {(test_expect_success)} {(SQ <"limit to path should show nothing">)} 
      {
        (SQ <"git diff-index --cached $tree -- path >current &&\n"> 
          <"     compare_diff_raw current expected">
        )
      }
    )
    (SimpleCommand
      words: [{(cat)}]
      redirects: [
        (Redir op_id:Redir_Great fd:-1 arg_word:{(expected)} spids:[86])
        (HereDoc
          op_id: Redir_DLess
          fd: -1
          body: 
            {
              (
":100644 100644 766498d93a4b06057a8e49d23f4068f1170ff38f 0a41e115ab61be0328a19b29f18cdcb49338d516 M\tpath1/file1\n"
              )
            }
          do_expansion: False
          here_end: EOF
          was_filled: True
          spids: [89]
        )
      ]
    )
    (C {(test_expect_success)} {(SQ <"limit to path1 should show path1/file1">)} 
      {
        (SQ <"git diff-index --cached $tree -- path1 >current &&\n"> 
          <"     compare_diff_raw current expected">
        )
      }
    )
    (SimpleCommand
      words: [{(cat)}]
      redirects: [
        (Redir op_id:Redir_Great fd:-1 arg_word:{(expected)} spids:[111])
        (HereDoc
          op_id: Redir_DLess
          fd: -1
          body: 
            {
              (
":100644 100644 766498d93a4b06057a8e49d23f4068f1170ff38f 0a41e115ab61be0328a19b29f18cdcb49338d516 M\tpath1/file1\n"
              )
            }
          do_expansion: False
          here_end: EOF
          was_filled: True
          spids: [114]
        )
      ]
    )
    (C {(test_expect_success)} {(SQ <"limit to path1/ should show path1/file1">)} 
      {
        (SQ <"git diff-index --cached $tree -- path1/ >current &&\n"> 
          <"     compare_diff_raw current expected">
        )
      }
    )
    (SimpleCommand
      words: [{(cat)}]
      redirects: [
        (Redir op_id:Redir_Great fd:-1 arg_word:{(expected)} spids:[136])
        (HereDoc
          op_id: Redir_DLess
          fd: -1
          body: 
            {
              (
":100644 100644 766498d93a4b06057a8e49d23f4068f1170ff38f 0a41e115ab61be0328a19b29f18cdcb49338d516 M\tpath1/file1\n"
              )
            }
          do_expansion: False
          here_end: EOF
          was_filled: True
          spids: [139]
        )
      ]
    )
    (C {(test_expect_success)} {(SQ <"\"*file1\" should show path1/file1">)} 
      {
        (SQ <"git diff-index --cached $tree -- \"*file1\" >current &&\n"> 
          <"     compare_diff_raw current expected">
        )
      }
    )
    (SimpleCommand
      words: [{(cat)}]
      redirects: [
        (Redir op_id:Redir_Great fd:-1 arg_word:{(expected)} spids:[161])
        (HereDoc
          op_id: Redir_DLess
          fd: -1
          body: 
            {
              (
":100644 100644 8e4020bb5a8d8c873b25de15933e75cc0fc275df dca6b92303befc93086aa025d90a5facd7eb2812 M\tfile0\n"
              )
            }
          do_expansion: False
          here_end: EOF
          was_filled: True
          spids: [164]
        )
      ]
    )
    (C {(test_expect_success)} {(SQ <"limit to file0 should show file0">)} 
      {
        (SQ <"git diff-index --cached $tree -- file0 >current &&\n"> 
          <"     compare_diff_raw current expected">
        )
      }
    )
    (SimpleCommand
      words: [{(cat)}]
      redirects: [
        (Redir op_id:Redir_Great fd:-1 arg_word:{(expected)} spids:[186])
        (HereDoc
          op_id: Redir_DLess
          fd: -1
          body: {}
          do_expansion: False
          here_end: EOF
          was_filled: True
          spids: [189]
        )
      ]
    )
    (C {(test_expect_success)} {(SQ <"limit to file0/ should emit nothing.">)} 
      {
        (SQ <"git diff-index --cached $tree -- file0/ >current &&\n"> 
          <"     compare_diff_raw current expected">
        )
      }
    )
    (C {(test_expect_success)} {(SQ <"diff-tree pathspec">)} 
      {
        (SQ <"\n"> <"\ttree2=$(git write-tree) &&\n"> <"\techo \"$tree2\" &&\n"> 
          <"\tgit diff-tree -r --name-only $tree $tree2 -- pa path1/a >current &&\n"> <"\t>expected &&\n"> <"\ttest_cmp expected current\n">
        )
      }
    )
    (C {(test_expect_success)} {(SQ <"diff-tree with wildcard shows dir also matches">)} 
      {
        (SQ <"\n"> <"\tgit diff-tree --name-only $EMPTY_TREE $tree -- \"f*\" >result &&\n"> 
          <"\techo file0 >expected &&\n"> <"\ttest_cmp expected result\n">
        )
      }
    )
    (C {(test_expect_success)} {(SQ <"diff-tree -r with wildcard">)} 
      {
        (SQ <"\n"> <"\tgit diff-tree -r --name-only $EMPTY_TREE $tree -- \"*file1\" >result &&\n"> 
          <"\techo path1/file1 >expected &&\n"> <"\ttest_cmp expected result\n">
        )
      }
    )
    (C {(test_expect_success)} {(SQ <"diff-tree with wildcard shows dir also matches">)} 
      {
        (SQ <"\n"> <"\tgit diff-tree --name-only $tree $tree2 -- \"path1/f*\" >result &&\n"> 
          <"\techo path1 >expected &&\n"> <"\ttest_cmp expected result\n">
        )
      }
    )
    (C {(test_expect_success)} {(SQ <"diff-tree -r with wildcard from beginning">)} 
      {
        (SQ <"\n"> <"\tgit diff-tree -r --name-only $tree $tree2 -- \"path1/*file1\" >result &&\n"> 
          <"\techo path1/file1 >expected &&\n"> <"\ttest_cmp expected result\n">
        )
      }
    )
    (C {(test_expect_success)} {(SQ <"diff-tree -r with wildcard">)} 
      {
        (SQ <"\n"> <"\tgit diff-tree -r --name-only $tree $tree2 -- \"path1/f*\" >result &&\n"> 
          <"\techo path1/file1 >expected &&\n"> <"\ttest_cmp expected result\n">
        )
      }
    )
    (C {(test_expect_success)} {(SQ <"setup submodules">)} 
      {
        (SQ <"\n"> <"\ttest_tick &&\n"> <"\tgit init submod &&\n"> 
          <"\t( cd submod && test_commit first; ) &&\n"> <"\tgit add submod &&\n"> <"\tgit commit -m first &&\n"> 
          <"\t( cd submod && test_commit second; ) &&\n"> <"\tgit add submod &&\n"> <"\tgit commit -m second\n">
        )
      }
    )
    (C {(test_expect_success)} {(SQ <"diff-tree ignores trailing slash on submodule path">)} 
      {
        (SQ <"\n"> <"\tgit diff --name-only HEAD^ HEAD submod >expect &&\n"> 
          <"\tgit diff --name-only HEAD^ HEAD submod/ >actual &&\n"> <"\ttest_cmp expect actual\n">
        )
      }
    )
    (C {(test_expect_success)} {(SQ <"diff multiple wildcard pathspecs">)} 
      {
        (SQ <"\n"> <"\tmkdir path2 &&\n"> <"\techo rezrov >path2/file1 &&\n"> 
          <"\tgit update-index --add path2/file1 &&\n"> <"\ttree3=$(git write-tree) &&\n"> 
          <"\tgit diff --name-only $tree $tree3 -- \"path2*1\" \"path1*1\" >actual &&\n"> <"\tcat <<-\\EOF >expect &&\n"> <"\tpath1/file1\n"> <"\tpath2/file1\n"> <"\tEOF\n"> 
          <"\ttest_cmp expect actual\n">
        )
      }
    )
    (C {(test_expect_success)} {(SQ <"diff-cache ignores trailing slash on submodule path">)} 
      {
        (SQ <"\n"> <"\tgit diff --name-only HEAD^ submod >expect &&\n"> 
          <"\tgit diff --name-only HEAD^ submod/ >actual &&\n"> <"\ttest_cmp expect actual\n">
        )
      }
    )
    (C {(test_done)})
  ]
)