(command.CommandList
  children: [
    (C {(test_tristate)} {(GIT_TEST_GIT_DAEMON)})
    (command.If
      arms: [
        (if_arm
          cond: [(C {(test)} {(DQ ($ VSub_Name '$GIT_TEST_GIT_DAEMON'))} {(Lit_Other '=')} {(false)})]
          action: [
            (command.Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (lhs_expr.LhsName name:skip_all spids:[79])
                  op: Equal
                  rhs: {(DQ ('git-daemon testing disabled (unset GIT_TEST_GIT_DAEMON to enable)'))}
                  spids: [79]
                )
              ]
              spids: [79]
            )
            (C {(test_done)})
          ]
          spids: [16777215 76]
        )
      ]
      spids: [16777215 87]
    )
    (command.If
      arms: [
        (if_arm
          cond: [(C {(test_have_prereq)} {(KW_Bang '!') (PIPE)})]
          action: [
            (C {(test_skip_or_die)} {($ VSub_Name '$GIT_TEST_GIT_DAEMON')} 
              {(DQ ('file system does not support FIFOs'))}
            )
          ]
          spids: [16777215 97]
        )
      ]
      spids: [16777215 108]
    )
    (command.Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (lhs_expr.LhsName name:LIB_GIT_DAEMON_PORT spids:[111])
          op: Equal
          rhs: 
            {
              (word_part.BracedVarSub
                token: <VSub_Name LIB_GIT_DAEMON_PORT>
                suffix_op: 
                  (suffix_op.StringUnary
                    op_id: VTest_Hyphen
                    arg_word: 
                      {
                        (word_part.BracedVarSub
                          token: <VSub_Name this_test>
                          suffix_op: (suffix_op.StringUnary op_id:VOp1_Pound arg_word:{(t)})
                          spids: [115 119]
                        )
                      }
                  )
                spids: [112 120]
              )
            }
          spids: [111]
        )
      ]
      spids: [111]
    )
    (command.Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (lhs_expr.LhsName name:GIT_DAEMON_PID spids:[123])
          op: Equal
          rhs: (word.EmptyWord)
          spids: [123]
        )
      ]
      spids: [123]
    )
    (command.Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (lhs_expr.LhsName name:GIT_DAEMON_DOCUMENT_ROOT_PATH spids:[125])
          op: Equal
          rhs: {(DQ ($ VSub_Name '$PWD')) (/repo)}
          spids: [125]
        )
      ]
      spids: [125]
    )
    (command.Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (lhs_expr.LhsName name:GIT_DAEMON_URL spids:[131])
          op: Equal
          rhs: 
            {(git) (Lit_Other ':') (//127.0.0.1) (Lit_Other ':') ($ VSub_Name '$LIB_GIT_DAEMON_PORT')}
          spids: [131]
        )
      ]
      spids: [131]
    )
    (command.FuncDef
      name: start_git_daemon
      body: 
        (command.BraceGroup
          children: [
            (command.If
              arms: [
                (if_arm
                  cond: [(C {(test)} {(-n)} {(DQ ($ VSub_Name '$GIT_DAEMON_PID'))})]
                  action: [(C {(error)} {(DQ ('start_git_daemon already called'))})]
                  spids: [16777215 157]
                )
              ]
              spids: [16777215 167]
            )
            (C {(mkdir)} {(-p)} {(DQ ($ VSub_Name '$GIT_DAEMON_DOCUMENT_ROOT_PATH'))})
            (C {(trap)} {(SQ <'code=$?; stop_git_daemon; (exit $code); die'>)} {(EXIT)})
            (command.SimpleCommand
              words: [{(say)} {(DQ ('Starting git daemon ...'))}]
              redirects: [(redir.Redir op:<Redir_GreatAnd '>&'> fd:16777215 arg_word:{(3)})]
            )
            (C {(mkfifo)} {(git_daemon_output)})
            (command.Sentence
              child: 
                (command.SimpleCommand
                  words: [
                    {(git)}
                    {(daemon)}
                    {(--listen) (Lit_Other '=') (127.0.0.1)}
                    {(--port) (Lit_Other '=') (DQ ($ VSub_Name '$LIB_GIT_DAEMON_PORT'))}
                    {(--reuseaddr)}
                    {(--verbose)}
                    {(--base-path) (Lit_Other '=') (DQ ($ VSub_Name '$GIT_DAEMON_DOCUMENT_ROOT_PATH'))}
                    {(DQ ($ VSub_At '$@'))}
                    {(DQ ($ VSub_Name '$GIT_DAEMON_DOCUMENT_ROOT_PATH'))}
                  ]
                  redirects: [
                    (redir.Redir
                      op: <Redir_GreatAnd '>&'>
                      fd: 16777215
                      arg_word: {(3)}
                    )
                    (redir.Redir
                      op: <Redir_Great '2>'>
                      fd: 2
                      arg_word: {(git_daemon_output)}
                    )
                  ]
                )
              terminator: <Op_Amp '&'>
            )
            (command.Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (lhs_expr.LhsName name:GIT_DAEMON_PID spids:[255])
                  op: Equal
                  rhs: {($ VSub_Bang '$!')}
                  spids: [255]
                )
              ]
              spids: [255]
            )
            (command.AndOr
              ops: [Op_DAmp]
              children: [
                (command.BraceGroup
                  children: [
                    (command.SimpleCommand
                      words: [{(read)} {(line)}]
                      redirects: [(redir.Redir op:<Redir_LessAnd '<&'> fd:16777215 arg_word:{(7)})]
                    )
                    (command.SimpleCommand
                      words: [{(echo)} {(DQ ($ VSub_Name '$line'))}]
                      redirects: [(redir.Redir op:<Redir_GreatAnd '>&'> fd:16777215 arg_word:{(4)})]
                    )
                    (command.Sentence
                      child: 
                        (command.SimpleCommand
                          words: [{(cat)}]
                          redirects: [
                            (redir.Redir
                              op: <Redir_LessAnd '<&'>
                              fd: 16777215
                              arg_word: {(7)}
                            )
                            (redir.Redir
                              op: <Redir_GreatAnd '>&'>
                              fd: 16777215
                              arg_word: {(4)}
                            )
                          ]
                        )
                      terminator: <Op_Amp '&'>
                    )
                  ]
                  redirects: [(redir.Redir op:<Redir_Less '7<'> fd:7 arg_word:{(git_daemon_output)})]
                  spids: [259]
                )
                (command.If
                  arms: [
                    (if_arm
                      cond: [
                        (C {(test)} 
                          {(x) 
                            (DQ 
                              (word_part.CommandSubPart
                                command_list: 
                                  (command.CommandList
                                    children: [
                                      (C {(expr)} {(DQ ($ VSub_Name '$line'))} {(Lit_Other ':')} 
                                        {
                                          (DQ (Lit_Other '\\') ('[[0-9]*') (Lit_Other '\\') ('] ') 
                                            (Lit_Other '\\') ('(.*') (Lit_Other '\\') (')')
                                          )
                                        }
                                      )
                                    ]
                                  )
                                left_token: <Left_CommandSub '$('>
                                spids: [310 329]
                              )
                            )
                          } {(KW_Bang '!') (Lit_Other '=')} {(x) (DQ ('Ready to rumble'))}
                        )
                      ]
                      action: [
                        (C {(kill)} {(DQ ($ VSub_Name '$GIT_DAEMON_PID'))})
                        (C {(wait)} {(DQ ($ VSub_Name '$GIT_DAEMON_PID'))})
                        (C {(trap)} {(SQ <die>)} {(EXIT)})
                        (C {(test_skip_or_die)} {($ VSub_Name '$GIT_TEST_GIT_DAEMON')} 
                          {(DQ ('git daemon failed to start'))}
                        )
                      ]
                      spids: [16777215 341]
                    )
                  ]
                  spids: [16777215 378]
                )
              ]
            )
          ]
          spids: [143]
        )
      spids: [139 142]
    )
    (command.FuncDef
      name: stop_git_daemon
      body: 
        (command.BraceGroup
          children: [
            (command.If
              arms: [
                (if_arm
                  cond: [(C {(test)} {(-z)} {(DQ ($ VSub_Name '$GIT_DAEMON_PID'))})]
                  action: [(command.ControlFlow token:<ControlFlow_Return return>)]
                  spids: [16777215 401]
                )
              ]
              spids: [16777215 407]
            )
            (C {(trap)} {(SQ <die>)} {(EXIT)})
            (command.SimpleCommand
              words: [{(say)} {(DQ ('Stopping git daemon ...'))}]
              redirects: [(redir.Redir op:<Redir_GreatAnd '>&'> fd:16777215 arg_word:{(3)})]
            )
            (C {(kill)} {(DQ ($ VSub_Name '$GIT_DAEMON_PID'))})
            (command.SimpleCommand
              words: [{(wait)} {(DQ ($ VSub_Name '$GIT_DAEMON_PID'))}]
              redirects: [
                (redir.Redir op:<Redir_GreatAnd '>&'> fd:16777215 arg_word:{(3)})
                (redir.Redir op:<Redir_GreatAnd '2>&'> fd:2 arg_word:{(4)})
              ]
            )
            (command.Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (lhs_expr.LhsName name:ret spids:[455])
                  op: Equal
                  rhs: {($ VSub_QMark '$?')}
                  spids: [455]
                )
              ]
              spids: [455]
            )
            (command.If
              arms: [
                (if_arm
                  cond: [(C {(test_match_signal)} {(15)} {($ VSub_QMark '$?')})]
                  action: [(C {(error)} {(DQ ('git daemon exited with status: ') ($ VSub_Name '$ret'))})]
                  spids: [16777215 468]
                )
              ]
              spids: [16777215 479]
            )
            (command.Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (lhs_expr.LhsName name:GIT_DAEMON_PID spids:[482])
                  op: Equal
                  rhs: (word.EmptyWord)
                  spids: [482]
                )
              ]
              spids: [482]
            )
            (C {(rm)} {(-f)} {(git_daemon_output)})
          ]
          spids: [387]
        )
      spids: [383 386]
    )
  ]
)