(command.CommandList
  children: [
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:test_description)
          op: assign_op.Equal
          rhs: {(SQ <'test git-http-backend-noserver'>)}
          spids: [4]
        )
      ]
    )
    (C {<.>} {<'./test-lib.sh'>})
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:HTTPD_DOCUMENT_ROOT_PATH)
          op: assign_op.Equal
          rhs: {(DQ ($ Id.VSub_DollarName '$TRASH_DIRECTORY'))}
          spids: [14]
        )
      ]
    )
    (command.If
      arms: [
        (if_arm
          cond: (condition.Shell commands:[(C {<test_have_prereq>} {<GREP_STRIPS_CR>})])
          action: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:GREP_OPTIONS)
                  op: assign_op.Equal
                  rhs: {<-U>}
                  spids: [29]
                )
              ]
            )
            (C {<export>} {<GREP_OPTIONS>})
          ]
          spids: [20 26]
        )
      ]
    )
    (command.ShFunction
      name: run_backend
      body: 
        (BraceGroup
          children: [
            (command.Pipeline
              children: [
                (C {<echo>} {(DQ ($ Id.VSub_Number '$2'))})
                (command.Simple
                  words: [{<git>} {<http-backend>}]
                  redirects: [
                    (redir
                      op: <Id.Redir_Great '>'>
                      loc: (redir_loc.Fd fd:1)
                      arg: {<act.out>}
                    )
                    (redir
                      op: <Id.Redir_Great '2>'>
                      loc: (redir_loc.Fd fd:2)
                      arg: {<act.err>}
                    )
                  ]
                  more_env: [
                    (env_pair
                      name: QUERY_STRING
                      val: 
                        {
                          (DQ 
                            (braced_var_sub
                              token: <Id.VSub_Number 1>
                              suffix_op: (suffix_op.Unary tok:<Id.VOp1_Pound '#'> arg_word:{<'*[?]'>})
                            )
                          )
                        }
                      spids: [56]
                    )
                    (env_pair
                      name: PATH_TRANSLATED
                      val: 
                        {
                          (DQ ($ Id.VSub_DollarName '$HTTPD_DOCUMENT_ROOT_PATH') <'/'> 
                            (braced_var_sub
                              token: <Id.VSub_Number 1>
                              suffix_op: 
                                (suffix_op.Unary
                                  tok: <Id.VOp1_DPercent '%%'>
                                  arg_word: {<'[?]*'>}
                                )
                            )
                          )
                        }
                      spids: [67]
                    )
                  ]
                  do_fork: T
                )
              ]
              negated: F
            )
          ]
        )
    )
    (command.ShFunction
      name: GET
      body: 
        (BraceGroup
          children: [
            (command.AndOr
              ops: [Id.Op_DAmp Id.Op_DAmp Id.Op_DAmp Id.Op_DAmp]
              children: [
                (command.ShAssignment
                  pairs: [
                    (assign_pair
                      lhs: (sh_lhs_expr.Name name:REQUEST_METHOD)
                      op: assign_op.Equal
                      rhs: {(DQ <GET>)}
                      spids: [100]
                    )
                  ]
                )
                (C {<export>} {<REQUEST_METHOD>})
                (C {<run_backend>} {(DQ <'/repo.git/'> ($ Id.VSub_Number '$1'))})
                (C {<sane_unset>} {<REQUEST_METHOD>})
                (command.If
                  arms: [
                    (if_arm
                      cond: 
                        (condition.Shell
                          commands: [
                            (command.Pipeline
                              children: [
                                (command.Simple
                                  words: [{<grep>} {(DQ <Status>)} {<act.out>}]
                                  redirects: [
                                    (redir
                                      op: <Id.Redir_Great '>'>
                                      loc: (redir_loc.Fd fd:1)
                                      arg: {<act>}
                                    )
                                  ]
                                  do_fork: T
                                )
                              ]
                              negated: T
                            )
                          ]
                        )
                      action: [
                        (command.Simple
                          words: [
                            {<printf>}
                            {
                              (DQ <'Status: 200 OK'> <Id.Lit_BadBackslash '\\'> <r> 
                                <Id.Lit_BadBackslash '\\'> <n>
                              )
                            }
                          ]
                          redirects: [
                            (redir
                              op: <Id.Redir_Great '>'>
                              loc: (redir_loc.Fd fd:1)
                              arg: {<act>}
                            )
                          ]
                          do_fork: T
                        )
                      ]
                      spids: [131 147]
                    )
                  ]
                )
              ]
            )
            (command.AndOr
              ops: [Id.Op_DAmp]
              children: [
                (command.Simple
                  words: [
                    {<printf>}
                    {
                      (DQ <'Status: '> ($ Id.VSub_Number '$2') <Id.Lit_BadBackslash '\\'> <r> 
                        <Id.Lit_BadBackslash '\\'> <n>
                      )
                    }
                  ]
                  redirects: [(redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<exp>})]
                  do_fork: T
                )
                (C {<test_cmp>} {<exp>} {<act>})
              ]
            )
          ]
        )
    )
    (command.ShFunction
      name: POST
      body: 
        (BraceGroup
          children: [
            (command.AndOr
              ops: [Id.Op_DAmp Id.Op_DAmp Id.Op_DAmp Id.Op_DAmp Id.Op_DAmp Id.Op_DAmp Id.Op_DAmp]
              children: [
                (command.ShAssignment
                  pairs: [
                    (assign_pair
                      lhs: (sh_lhs_expr.Name name:REQUEST_METHOD)
                      op: assign_op.Equal
                      rhs: {(DQ <POST>)}
                      spids: [200]
                    )
                  ]
                )
                (C {<export>} {<REQUEST_METHOD>})
                (command.ShAssignment
                  pairs: [
                    (assign_pair
                      lhs: (sh_lhs_expr.Name name:CONTENT_TYPE)
                      op: assign_op.Equal
                      rhs: {(DQ <'application/x-'> ($ Id.VSub_Number '$1') <-request>)}
                      spids: [214]
                    )
                  ]
                )
                (C {<export>} {<CONTENT_TYPE>})
                (C {<run_backend>} {(DQ <'/repo.git/'> ($ Id.VSub_Number '$1'))} 
                  {(DQ ($ Id.VSub_Number '$2'))}
                )
                (C {<sane_unset>} {<REQUEST_METHOD>})
                (C {<sane_unset>} {<CONTENT_TYPE>})
                (command.If
                  arms: [
                    (if_arm
                      cond: 
                        (condition.Shell
                          commands: [
                            (command.Pipeline
                              children: [
                                (command.Simple
                                  words: [{<grep>} {(DQ <Status>)} {<act.out>}]
                                  redirects: [
                                    (redir
                                      op: <Id.Redir_Great '>'>
                                      loc: (redir_loc.Fd fd:1)
                                      arg: {<act>}
                                    )
                                  ]
                                  do_fork: T
                                )
                              ]
                              negated: T
                            )
                          ]
                        )
                      action: [
                        (command.Simple
                          words: [
                            {<printf>}
                            {
                              (DQ <'Status: 200 OK'> <Id.Lit_BadBackslash '\\'> <r> 
                                <Id.Lit_BadBackslash '\\'> <n>
                              )
                            }
                          ]
                          redirects: [
                            (redir
                              op: <Id.Redir_Great '>'>
                              loc: (redir_loc.Fd fd:1)
                              arg: {<act>}
                            )
                          ]
                          do_fork: T
                        )
                      ]
                      spids: [258 274]
                    )
                  ]
                )
              ]
            )
            (command.AndOr
              ops: [Id.Op_DAmp]
              children: [
                (command.Simple
                  words: [
                    {<printf>}
                    {
                      (DQ <'Status: '> ($ Id.VSub_Number '$3') <Id.Lit_BadBackslash '\\'> <r> 
                        <Id.Lit_BadBackslash '\\'> <n>
                      )
                    }
                  ]
                  redirects: [(redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<exp>})]
                  do_fork: T
                )
                (C {<test_cmp>} {<exp>} {<act>})
              ]
            )
          ]
        )
    )
    (C {<.>} {(DQ ($ Id.VSub_DollarName '$TEST_DIRECTORY')) <'/t556x_common'>})
    (command.ShFunction
      name: expect_aliased
      body: 
        (BraceGroup
          children: [
            (command.AndOr
              ops: [Id.Op_DAmp Id.Op_DAmp]
              children: [
                (command.ShAssignment
                  pairs: [
                    (assign_pair
                      lhs: (sh_lhs_expr.Name name:REQUEST_METHOD)
                      op: assign_op.Equal
                      rhs: {(DQ <GET>)}
                      spids: [335]
                    )
                  ]
                )
                (C {<export>} {<REQUEST_METHOD>})
                (command.If
                  arms: [
                    (if_arm
                      cond: 
                        (condition.Shell
                          commands: [
                            (command.Sentence
                              child: (C {<test>} {($ Id.VSub_Number '$1')} {<Id.Lit_Equals '='>} {<0>})
                              terminator: <Id.Op_Semi _>
                            )
                          ]
                        )
                      action: [(C {<run_backend>} {(DQ ($ Id.VSub_Number '$2'))})]
                      spids: [349 360]
                    )
                  ]
                  else_action: [
                    (command.AndOr
                      ops: [Id.Op_DAmp Id.Op_DAmp]
                      children: [
                        (C {<run_backend>} {(DQ ($ Id.VSub_Number '$2'))})
                        (command.Simple
                          words: [{<echo>} {(DQ <'fatal: \''> ($ Id.VSub_Number '$2') <'\': aliased'>)}]
                          redirects: [
                            (redir
                              op: <Id.Redir_Great '>'>
                              loc: (redir_loc.Fd fd:1)
                              arg: {<exp.err>}
                            )
                          ]
                          do_fork: T
                        )
                        (C {<test_cmp>} {<exp.err>} {<act.err>})
                      ]
                    )
                  ]
                )
              ]
            )
            (C {<unset>} {<REQUEST_METHOD>})
          ]
        )
    )
    (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>})
  ]
)