(command.CommandList
  children: [
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:test_description)
          op: assign_op.Equal
          rhs: {(SQ (Token id:Id.Lit_Chars val:'git archive attribute tests' span_id:6))}
          spids: [4]
        )
      ]
    )
    (C {(.)} {(./test-lib.sh)})
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:SUBSTFORMAT)
          op: assign_op.Equal
          rhs: {(SQ (Token id:Id.Lit_Chars val:'%H (%h)%n' span_id:17))}
          spids: [15]
        )
      ]
    )
    (command.ShFunction
      name: test_expect_exists
      body: 
        (command.BraceGroup
          children: [
            (C {(test_expect_success)} {(DQ (' ') ($ Id.VSub_Number '$1') (' exists'))} 
              {(DQ ('test -e ') ($ Id.VSub_Number '$1'))}
            )
          ]
        )
    )
    (command.ShFunction
      name: test_expect_missing
      body: 
        (command.BraceGroup
          children: [
            (C {(test_expect_success)} {(DQ (' ') ($ Id.VSub_Number '$1') (' does not exist'))} 
              {(DQ ('test ! -e ') ($ Id.VSub_Number '$1'))}
            )
          ]
        )
    )
    (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:setup span_id:70))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:74) 
          (Token id:Id.Lit_Chars val:'\techo ignored >ignored &&\n' span_id:75) (Token id:Id.Lit_Chars val:'\techo ignored export-ignore >>.git/info/attributes &&\n' span_id:76) 
          (Token id:Id.Lit_Chars val:'\tgit add ignored &&\n' span_id:77) (Token id:Id.Lit_Chars val:'\n' span_id:78) 
          (Token
            id: Id.Lit_Chars
            val: '\techo ignored by tree >ignored-by-tree &&\n'
            span_id: 79
          ) (Token id:Id.Lit_Chars val:'\techo ignored-by-tree export-ignore >.gitattributes &&\n' span_id:80) 
          (Token
            id: Id.Lit_Chars
            val: '\tgit add ignored-by-tree .gitattributes &&\n'
            span_id: 81
          ) (Token id:Id.Lit_Chars val:'\n' span_id:82) 
          (Token
            id: Id.Lit_Chars
            val: '\techo ignored by worktree >ignored-by-worktree &&\n'
            span_id: 83
          ) 
          (Token
            id: Id.Lit_Chars
            val: '\techo ignored-by-worktree export-ignore >.gitattributes &&\n'
            span_id: 84
          ) (Token id:Id.Lit_Chars val:'\tgit add ignored-by-worktree &&\n' span_id:85) 
          (Token id:Id.Lit_Chars val:'\n' span_id:86) 
          (Token
            id: Id.Lit_Chars
            val: '\tprintf "A\\$Format:%s\\$O" "$SUBSTFORMAT" >nosubstfile &&\n'
            span_id: 87
          ) (Token id:Id.Lit_Chars val:'\tprintf "A\\$Format:%s\\$O" "$SUBSTFORMAT" >substfile1 &&\n' span_id:88) 
          (Token
            id: Id.Lit_Chars
            val: '\tprintf "A not substituted O" >substfile2 &&\n'
            span_id: 89
          ) (Token id:Id.Lit_Chars val:'\techo "substfile?" export-subst >>.git/info/attributes &&\n' span_id:90) 
          (Token
            id: Id.Lit_Chars
            val: '\tgit add nosubstfile substfile1 substfile2 &&\n'
            span_id: 91
          ) (Token id:Id.Lit_Chars val:'\n' span_id:92) 
          (Token id:Id.Lit_Chars val:'\tgit commit -m. &&\n' span_id:93) (Token id:Id.Lit_Chars val:'\n' span_id:94) 
          (Token id:Id.Lit_Chars val:'\tgit clone --bare . bare &&\n' span_id:95) (Token id:Id.Lit_Chars val:'\tcp .git/info/attributes bare/info/attributes\n' span_id:96)
        )
      }
    )
    (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'git archive' span_id:103))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:107) 
          (Token id:Id.Lit_Chars val:'\tgit archive HEAD >archive.tar &&\n' span_id:108) 
          (Token
            id: Id.Lit_Chars
            val: '\t(mkdir archive && cd archive && "$TAR" xf -) <archive.tar\n'
            span_id: 109
          )
        )
      }
    )
    (C {(test_expect_missing)} {(archive/ignored)})
    (C {(test_expect_missing)} {(archive/ignored-by-tree)})
    (C {(test_expect_exists)} {(archive/ignored-by-worktree)})
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'git archive with worktree attributes' span_id:129))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:133) 
          (Token
            id: Id.Lit_Chars
            val: '\tgit archive --worktree-attributes HEAD >worktree.tar &&\n'
            span_id: 134
          ) 
          (Token
            id: Id.Lit_Chars
            val: '\t(mkdir worktree && cd worktree && "$TAR" xf -) <worktree.tar\n'
            span_id: 135
          )
        )
      }
    )
    (C {(test_expect_missing)} {(worktree/ignored)})
    (C {(test_expect_exists)} {(worktree/ignored-by-tree)})
    (C {(test_expect_missing)} {(worktree/ignored-by-worktree)})
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'git archive --worktree-attributes option' span_id:155))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:159) 
          (Token
            id: Id.Lit_Chars
            val: '\tgit archive --worktree-attributes --worktree-attributes HEAD >worktree.tar &&\n'
            span_id: 160
          ) 
          (Token
            id: Id.Lit_Chars
            val: '\t(mkdir worktree2 && cd worktree2 && "$TAR" xf -) <worktree.tar\n'
            span_id: 161
          )
        )
      }
    )
    (C {(test_expect_missing)} {(worktree2/ignored)})
    (C {(test_expect_exists)} {(worktree2/ignored-by-tree)})
    (C {(test_expect_missing)} {(worktree2/ignored-by-worktree)})
    (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'git archive vs. bare' span_id:181))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:185) 
          (Token
            id: Id.Lit_Chars
            val: '\t(cd bare && git archive HEAD) >bare-archive.tar &&\n'
            span_id: 186
          ) (Token id:Id.Lit_Chars val:'\ttest_cmp_bin archive.tar bare-archive.tar\n' span_id:187)
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'git archive with worktree attributes, bare' span_id:194))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:198) 
          (Token
            id: Id.Lit_Chars
            val: '\t(cd bare && git archive --worktree-attributes HEAD) >bare-worktree.tar &&\n'
            span_id: 199
          ) 
          (Token
            id: Id.Lit_Chars
            val: '\t(mkdir bare-worktree && cd bare-worktree && "$TAR" xf -) <bare-worktree.tar\n'
            span_id: 200
          )
        )
      }
    )
    (C {(test_expect_missing)} {(bare-worktree/ignored)})
    (C {(test_expect_exists)} {(bare-worktree/ignored-by-tree)})
    (C {(test_expect_exists)} {(bare-worktree/ignored-by-worktree)})
    (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:export-subst span_id:220))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:224) 
          (Token
            id: Id.Lit_Chars
            val: '\tgit log "--pretty=format:A${SUBSTFORMAT}O" HEAD >substfile1.expected &&\n'
            span_id: 225
          ) (Token id:Id.Lit_Chars val:'\ttest_cmp nosubstfile archive/nosubstfile &&\n' span_id:226) 
          (Token
            id: Id.Lit_Chars
            val: '\ttest_cmp substfile1.expected archive/substfile1 &&\n'
            span_id: 227
          ) (Token id:Id.Lit_Chars val:'\ttest_cmp substfile2 archive/substfile2\n' span_id:228)
        )
      }
    )
    (C {(test_done)})
  ]
)