(command.CommandList
  children: [
    (command.Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (lhs_expr.LhsName name:test_description spids:[12])
          op: Equal
          rhs: {(SQ <'test git-http-backend-noserver'>)}
          spids: [12]
        )
      ]
      spids: [12]
    )
    (C {(.)} {(./test-lib.sh)})
    (command.Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (lhs_expr.LhsName name:HTTPD_DOCUMENT_ROOT_PATH spids:[22])
          op: Equal
          rhs: {(DQ ($ VSub_Name '$TRASH_DIRECTORY'))}
          spids: [22]
        )
      ]
      spids: [22]
    )
    (command.If
      arms: [
        (if_arm
          cond: [(C {(test_have_prereq)} {(GREP_STRIPS_CR)})]
          action: [
            (command.Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (lhs_expr.LhsName name:GREP_OPTIONS spids:[37])
                  op: Equal
                  rhs: {(-U)}
                  spids: [37]
                )
              ]
              spids: [37]
            )
            (C {(export)} {(GREP_OPTIONS)})
          ]
          spids: [16777215 34]
        )
      ]
      spids: [16777215 45]
    )
    (command.FuncDef
      name: run_backend
      body: 
        (command.BraceGroup
          children: [
            (command.Pipeline
              children: [
                (C {(echo)} {(DQ ($ VSub_Number '$2'))})
                (command.SimpleCommand
                  words: [{(git)} {(http-backend)}]
                  redirects: [
                    (redir.Redir
                      op: <Redir_Great '>'>
                      fd: 16777215
                      arg_word: {(act.out)}
                    )
                    (redir.Redir op:<Redir_Great '2>'> fd:2 arg_word:{(act.err)})
                  ]
                  more_env: [
                    (env_pair
                      name: QUERY_STRING
                      val: 
                        {
                          (DQ 
                            (word_part.BracedVarSub
                              token: <VSub_Number 1>
                              suffix_op: (suffix_op.StringUnary op_id:VOp1_Pound arg_word:{('*[?]')})
                              spids: [66 70]
                            )
                          )
                        }
                      spids: [64]
                    )
                    (env_pair
                      name: PATH_TRANSLATED
                      val: 
                        {
                          (DQ ($ VSub_Name '$HTTPD_DOCUMENT_ROOT_PATH') (/) 
                            (word_part.BracedVarSub
                              token: <VSub_Number 1>
                              suffix_op: 
                                (suffix_op.StringUnary
                                  op_id: VOp1_DPercent
                                  arg_word: {('[?]*')}
                                )
                              spids: [79 83]
                            )
                          )
                        }
                      spids: [75]
                    )
                  ]
                )
              ]
              negated: F
            )
          ]
          spids: [52]
        )
      spids: [48 51]
    )
    (command.FuncDef
      name: GET
      body: 
        (command.BraceGroup
          children: [
            (command.AndOr
              ops: [Op_DAmp Op_DAmp Op_DAmp Op_DAmp]
              children: [
                (command.Assignment
                  keyword: Assign_None
                  pairs: [
                    (assign_pair
                      lhs: (lhs_expr.LhsName name:REQUEST_METHOD spids:[108])
                      op: Equal
                      rhs: {(DQ (GET))}
                      spids: [108]
                    )
                  ]
                  spids: [108]
                )
                (C {(export)} {(REQUEST_METHOD)})
                (C {(run_backend)} {(DQ (/repo.git/) ($ VSub_Number '$1'))})
                (C {(sane_unset)} {(REQUEST_METHOD)})
                (command.If
                  arms: [
                    (if_arm
                      cond: [
                        (command.Pipeline
                          children: [
                            (command.SimpleCommand
                              words: [{(grep)} {(DQ (Status))} {(act.out)}]
                              redirects: [
                                (redir.Redir
                                  op: <Redir_Great '>'>
                                  fd: 16777215
                                  arg_word: {(act)}
                                )
                              ]
                            )
                          ]
                          negated: T
                        )
                      ]
                      action: [
                        (command.SimpleCommand
                          words: [
                            {(printf)}
                            {(DQ ('Status: 200 OK') (Lit_Other '\\') (r) (Lit_Other '\\') (n))}
                          ]
                          redirects: [(redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(act)})]
                        )
                      ]
                      spids: [16777215 155]
                    )
                  ]
                  spids: [16777215 172]
                )
              ]
            )
            (command.AndOr
              ops: [Op_DAmp]
              children: [
                (command.SimpleCommand
                  words: [
                    {(printf)}
                    {
                      (DQ ('Status: ') ($ VSub_Number '$2') (Lit_Other '\\') (r) (Lit_Other '\\') (n))
                    }
                  ]
                  redirects: [(redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(exp)})]
                )
                (C {(test_cmp)} {(exp)} {(act)})
              ]
            )
          ]
          spids: [105]
        )
      spids: [101 104]
    )
    (command.FuncDef
      name: POST
      body: 
        (command.BraceGroup
          children: [
            (command.AndOr
              ops: [Op_DAmp Op_DAmp Op_DAmp Op_DAmp Op_DAmp Op_DAmp Op_DAmp]
              children: [
                (command.Assignment
                  keyword: Assign_None
                  pairs: [
                    (assign_pair
                      lhs: (lhs_expr.LhsName name:REQUEST_METHOD spids:[208])
                      op: Equal
                      rhs: {(DQ (POST))}
                      spids: [208]
                    )
                  ]
                  spids: [208]
                )
                (C {(export)} {(REQUEST_METHOD)})
                (command.Assignment
                  keyword: Assign_None
                  pairs: [
                    (assign_pair
                      lhs: (lhs_expr.LhsName name:CONTENT_TYPE spids:[222])
                      op: Equal
                      rhs: {(DQ (application/x-) ($ VSub_Number '$1') (-request))}
                      spids: [222]
                    )
                  ]
                  spids: [222]
                )
                (C {(export)} {(CONTENT_TYPE)})
                (C {(run_backend)} {(DQ (/repo.git/) ($ VSub_Number '$1'))} {(DQ ($ VSub_Number '$2'))})
                (C {(sane_unset)} {(REQUEST_METHOD)})
                (C {(sane_unset)} {(CONTENT_TYPE)})
                (command.If
                  arms: [
                    (if_arm
                      cond: [
                        (command.Pipeline
                          children: [
                            (command.SimpleCommand
                              words: [{(grep)} {(DQ (Status))} {(act.out)}]
                              redirects: [
                                (redir.Redir
                                  op: <Redir_Great '>'>
                                  fd: 16777215
                                  arg_word: {(act)}
                                )
                              ]
                            )
                          ]
                          negated: T
                        )
                      ]
                      action: [
                        (command.SimpleCommand
                          words: [
                            {(printf)}
                            {(DQ ('Status: 200 OK') (Lit_Other '\\') (r) (Lit_Other '\\') (n))}
                          ]
                          redirects: [(redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(act)})]
                        )
                      ]
                      spids: [16777215 282]
                    )
                  ]
                  spids: [16777215 299]
                )
              ]
            )
            (command.AndOr
              ops: [Op_DAmp]
              children: [
                (command.SimpleCommand
                  words: [
                    {(printf)}
                    {
                      (DQ ('Status: ') ($ VSub_Number '$3') (Lit_Other '\\') (r) (Lit_Other '\\') (n))
                    }
                  ]
                  redirects: [(redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(exp)})]
                )
                (C {(test_cmp)} {(exp)} {(act)})
              ]
            )
          ]
          spids: [205]
        )
      spids: [201 204]
    )
    (C {(.)} {(DQ ($ VSub_Name '$TEST_DIRECTORY')) (/t556x_common)})
    (command.FuncDef
      name: expect_aliased
      body: 
        (command.BraceGroup
          children: [
            (command.AndOr
              ops: [Op_DAmp Op_DAmp]
              children: [
                (command.Assignment
                  keyword: Assign_None
                  pairs: [
                    (assign_pair
                      lhs: (lhs_expr.LhsName name:REQUEST_METHOD spids:[343])
                      op: Equal
                      rhs: {(DQ (GET))}
                      spids: [343]
                    )
                  ]
                  spids: [343]
                )
                (C {(export)} {(REQUEST_METHOD)})
                (command.If
                  arms: [
                    (if_arm
                      cond: [
                        (command.Sentence
                          child: (C {(test)} {($ VSub_Number '$1')} {(Lit_Other '=')} {(0)})
                          terminator: <Op_Semi ';'>
                        )
                      ]
                      action: [(C {(run_backend)} {(DQ ($ VSub_Number '$2'))})]
                      spids: [16777215 368]
                    )
                  ]
                  else_action: [
                    (command.AndOr
                      ops: [Op_DAmp Op_DAmp]
                      children: [
                        (C {(run_backend)} {(DQ ($ VSub_Number '$2'))})
                        (command.SimpleCommand
                          words: [{(echo)} {(DQ ("fatal: '") ($ VSub_Number '$2') ("': aliased"))}]
                          redirects: [
                            (redir.Redir
                              op: <Redir_Great '>'>
                              fd: 16777215
                              arg_word: {(exp.err)}
                            )
                          ]
                        )
                        (C {(test_cmp)} {(exp.err)} {(act.err)})
                      ]
                    )
                  ]
                  spids: [378 411]
                )
              ]
            )
            (C {(unset)} {(REQUEST_METHOD)})
          ]
          spids: [340]
        )
      spids: [336 339]
    )
    (C {(test_expect_success)} {(SQ <'http-backend blocks bad PATH_INFO'>)} 
      {
        (SQ <'\n'> <'\tconfig http.getanyfile true &&\n'> <'\n'> 
          <'\texpect_aliased 0 /repo.git/HEAD &&\n'> <'\n'> <'\texpect_aliased 1 /repo.git/../HEAD &&\n'> <'\texpect_aliased 1 /../etc/passwd &&\n'> 
          <'\texpect_aliased 1 ../etc/passwd &&\n'> <'\texpect_aliased 1 /etc//passwd &&\n'> <'\texpect_aliased 1 /etc/./passwd &&\n'> 
          <'\texpect_aliased 1 //domain/data.txt\n'>
        )
      }
    )
    (C {(test_done)})
  ]
)