(command.CommandList
  children: [
    (command.Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (lhs_expr.LhsName name:test_description spids:[12])
          op: Equal
          rhs: {(SQ <'check that read-tree rejects confusing paths'>)}
          spids: [12]
        )
      ]
      spids: [12]
    )
    (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'>)}
    )
    (command.WhileUntil
      keyword: <KW_While while>
      cond: [(command.Sentence child:(C {(read)} {(path)} {(pretty)}) terminator:<Op_Semi ';'>)]
      body: 
        (command.DoGroup
          children: [
            (C {(Lit_Other ':')} 
              {
                (word_part.BracedVarSub
                  token: <VSub_Name pretty>
                  suffix_op: 
                    (suffix_op.StringUnary
                      op_id: VTest_ColonEquals
                      arg_word: {($ VSub_Name '$path')}
                    )
                  spids: [76 80]
                )
              }
            )
            (command.Case
              to_match: {(DQ ($ VSub_Name '$path'))}
              arms: [
                (case_arm
                  pat_list: [{(Lit_Other '*') (SPACE)}]
                  action: [
                    (command.Assignment
                      keyword: Assign_None
                      pairs: [
                        (assign_pair
                          lhs: (lhs_expr.LhsName name:path spids:[97])
                          op: Equal
                          rhs: 
                            {
                              (DQ 
                                (word_part.BracedVarSub
                                  token: <VSub_Name path>
                                  suffix_op: 
                                    (suffix_op.StringUnary
                                      op_id: VOp1_Percent
                                      arg_word: {(SPACE)}
                                    )
                                  spids: [99 103]
                                ) (' ')
                              )
                            }
                          spids: [97]
                        )
                      ]
                      spids: [97]
                    )
                  ]
                  spids: [92 94 108 16777215]
                )
              ]
              spids: [83 89 111]
            )
            (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: [71 148]
        )
      redirects: [
        (redir.HereDoc
          op: <Redir_DLessDash '<<-'>
          fd: 16777215
          here_begin: {(EOF)}
          here_end_span_id: 185
          stdin_parts: [
            ('.\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')
            (.)
            (word_part.EscapedLiteralPart token:<Lit_EscapedChar '\\\\'>)
            (word_part.EscapedLiteralPart token:<Lit_EscapedChar '\\\\'>)
            (.GIT)
            (word_part.EscapedLiteralPart token:<Lit_EscapedChar '\\\\'>)
            (word_part.EscapedLiteralPart token:<Lit_EscapedChar '\\\\'>)
            ('foobar backslashes\n')
            (.git)
            (word_part.EscapedLiteralPart token:<Lit_EscapedChar '\\\\'>)
            (word_part.EscapedLiteralPart token:<Lit_EscapedChar '\\\\'>)
            ('foobar backslashes2\n')
          ]
        )
      ]
    )
    (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)})
  ]
)