(CommandList
  children: [
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:test_description)
          op: Equal
          rhs: {(SQ <'check that read-tree rejects confusing paths'>)}
          spids: [4]
        )
      ]
      spids: [4]
    )
    (C {(.)} {(./test-lib.sh)})
    (C {(test_expect_success)} {(SQ <'create base tree'>)} 
      {
        (SQ <'\n'> <'\techo content >file &&\n'> <'\tgit add file &&\n'> <'\tgit commit -m base &&\n'> 
          <'\tblob=$(git rev-parse HEAD:file) &&\n'> <'\ttree=$(git rev-parse HEAD^{tree})\n'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'enable core.protectHFS for rejection tests'>)} 
      {(SQ <'\n'> <'\tgit config core.protectHFS true\n'>)}
    )
    (C {(test_expect_success)} {(SQ <'enable core.protectNTFS for rejection tests'>)} 
      {(SQ <'\n'> <'\tgit config core.protectNTFS true\n'>)}
    )
    (While
      cond: [(Sentence child:(C {(read)} {(path)} {(pretty)}) terminator:<Op_Semi ';'>)]
      body: 
        (DoGroup
          children: [
            (C {(Lit_Other ':')} 
              {
                (BracedVarSub
                  token: <VSub_Name pretty>
                  suffix_op: (StringUnary op_id:VTest_ColonEquals arg_word:{($ VSub_Name '$path')})
                  spids: [68 72]
                )
              }
            )
            (Case
              to_match: {(DQ ($ VSub_Name '$path'))}
              arms: [
                (case_arm
                  pat_list: [{(Lit_Other '*') (SPACE)}]
                  action: [
                    (Assignment
                      keyword: Assign_None
                      pairs: [
                        (assign_pair
                          lhs: (LhsName name:path)
                          op: Equal
                          rhs: 
                            {
                              (DQ 
                                (BracedVarSub
                                  token: <VSub_Name path>
                                  suffix_op: (StringUnary op_id:VOp1_Percent arg_word:{(SPACE)})
                                  spids: [91 95]
                                ) (' ')
                              )
                            }
                          spids: [89]
                        )
                      ]
                      spids: [89]
                    )
                  ]
                  spids: [84 86 100 16777215]
                )
              ]
              spids: [75 81 103]
            )
            (C {(test_expect_success)} {(DQ ('reject ') ($ VSub_Name '$pretty') (' at end of path'))} 
              {
                (SQ <'\n'> <'\t\tprintf "100644 blob %s\\t%s" "$blob" "$path" >tree &&\n'> 
                  <'\t\tbogus=$(git mktree <tree) &&\n'> <'\t\ttest_must_fail git read-tree $bogus\n'> <'\t'>
                )
              }
            )
            (C {(test_expect_success)} {(DQ ('reject ') ($ VSub_Name '$pretty') (' as subtree'))} 
              {
                (SQ <'\n'> <'\t\tprintf "040000 tree %s\\t%s" "$tree" "$path" >tree &&\n'> 
                  <'\t\tbogus=$(git mktree <tree) &&\n'> <'\t\ttest_must_fail git read-tree $bogus\n'> <'\t'>
                )
              }
            )
          ]
          spids: [63 140]
        )
      redirects: [
        (HereDoc
          op_id: Redir_DLessDash
          fd: 16777215
          body: 
            {
              (DQ ('.\n') ('..\n') ('.git\n') ('.GIT\n') (${ VSub_Name u200c) ('.Git {u200c}.Git\n') (.gI) 
                (${ VSub_Name u200c) ('T .gI{u200c}T\n') (.GiT) (${ VSub_Name u200c) (' .GiT{u200c}\n') ('git~1\n') 
                ('.git.SPACE .git.{space}\n') (.) (EscapedLiteralPart token:<Lit_EscapedChar '\\\\'>) 
                (EscapedLiteralPart token:<Lit_EscapedChar '\\\\'>) (.GIT) (EscapedLiteralPart token:<Lit_EscapedChar '\\\\'>) 
                (EscapedLiteralPart token:<Lit_EscapedChar '\\\\'>) ('foobar backslashes\n') (.git) (EscapedLiteralPart token:<Lit_EscapedChar '\\\\'>) 
                (EscapedLiteralPart token:<Lit_EscapedChar '\\\\'>) ('foobar backslashes2\n')
              )
            }
          do_expansion: True
          here_end: EOF
          was_filled: T
          spids: [142]
        )
      ]
    )
    (C {(test_expect_success)} {(SQ <'utf-8 paths allowed with core.protectHFS off'>)} 
      {
        (SQ <'\n'> <'\ttest_when_finished "git read-tree HEAD" &&\n'> 
          <'\ttest_config core.protectHFS false &&\n'> <'\tprintf "100644 blob %s\\t%s" "$blob" ".gi${u200c}t" >tree &&\n'> <'\tok=$(git mktree <tree) &&\n'> 
          <'\tgit read-tree $ok\n'>
        )
      }
    )
    (C {(test_done)})
  ]
)