(command.CommandList
  children: [
    (command.Sentence
      child: 
        (command.AndOr
          ops: [Id.Op_DPipe]
          children: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:GIT_DIR)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (command_sub
                        left_token: <Id.Left_DollarParen '$('>
                        child: (C {<git>} {<rev-parse>} {<-q>} {<--git-dir>})
                      )
                    }
                  spids: [16]
                )
              ]
            )
            (C {<Id.Lit_Colon ':'>})
          ]
        )
      terminator: <Id.Op_Semi _>
    )
    (command.ShFunction
      name: get_default_remote
      body: 
        (BraceGroup
          children: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:curr_branch)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (command_sub
                        left_token: <Id.Left_DollarParen '$('>
                        child: (C {<git>} {<symbolic-ref>} {<-q>} {<HEAD>})
                      )
                    }
                  spids: [41]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:curr_branch)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (DQ 
                        (braced_var_sub
                          token: <Id.VSub_Name curr_branch>
                          suffix_op: 
                            (suffix_op.Unary
                              op_id: Id.VOp1_Pound
                              arg_word: {<refs> <Id.Lit_Slash '/'> <heads> <Id.Lit_Slash '/'>}
                            )
                        )
                      )
                    }
                  spids: [53]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:origin)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (command_sub
                        left_token: <Id.Left_DollarParen '$('>
                        child: 
                          (C {<git>} {<config>} {<--get>} 
                            {(DQ <branch.> ($ Id.VSub_DollarName '$curr_branch') <.remote>)}
                          )
                      )
                    }
                  spids: [66]
                )
              ]
            )
            (C {<echo>} 
              {
                (braced_var_sub
                  token: <Id.VSub_Name origin>
                  suffix_op: (suffix_op.Unary op_id:Id.VTest_ColonHyphen arg_word:{<origin>})
                )
              }
            )
          ]
        )
    )
    (command.ShFunction
      name: get_remote_merge_branch
      body: 
        (BraceGroup
          children: [
            (command.Case
              to_match: {(DQ ($ Id.VSub_Pound '$#'))}
              arms: [
                (case_arm
                  pat_list: [{<0>} {<1>}]
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:origin)
                          op: assign_op.Equal
                          rhs: {(DQ ($ Id.VSub_Number '$1'))}
                          spids: [116]
                        )
                      ]
                    )
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:default)
                          op: assign_op.Equal
                          rhs: 
                            {
                              (command_sub
                                left_token: <Id.Left_DollarParen '$('>
                                child: (C {<get_default_remote>})
                              )
                            }
                          spids: [122]
                        )
                      ]
                    )
                    (command.AndOr
                      ops: [Id.Op_DAmp]
                      children: [
                        (C {<test>} {<-z>} {(DQ ($ Id.VSub_DollarName '$origin'))})
                        (command.ShAssignment
                          pairs: [
                            (assign_pair
                              lhs: (sh_lhs_expr.Name name:origin)
                              op: assign_op.Equal
                              rhs: {($ Id.VSub_DollarName '$default')}
                              spids: [138]
                            )
                          ]
                        )
                      ]
                    )
                    (command.AndOr
                      ops: [Id.Op_DAmp Id.Op_DAmp]
                      children: [
                        (command.ShAssignment
                          pairs: [
                            (assign_pair
                              lhs: (sh_lhs_expr.Name name:curr_branch)
                              op: assign_op.Equal
                              rhs: 
                                {
                                  (command_sub
                                    left_token: <Id.Left_DollarParen '$('>
                                    child: (C {<git>} {<symbolic-ref>} {<-q>} {<HEAD>})
                                  )
                                }
                              spids: [142]
                            )
                          ]
                        )
                        (C {<Id.Lit_LBracket '['>} {(DQ ($ Id.VSub_DollarName '$origin'))} 
                          {<Id.Lit_Equals '='>} {(DQ ($ Id.VSub_DollarName '$default'))} {<Id.Lit_RBracket ']'>}
                        )
                        (C {<echo>} 
                          {
                            (command_sub
                              left_token: <Id.Left_DollarParen '$('>
                              child: 
                                (C {<git>} {<for-each-ref>} 
                                  {<--format> <Id.Lit_Equals '='> (SQ <'%(upstream)'>)} {($ Id.VSub_DollarName '$curr_branch')}
                                )
                            )
                          }
                        )
                      ]
                    )
                  ]
                  spids: [110 113 190 -1]
                )
                (case_arm
                  pat_list: [{<Id.Lit_Star '*'>}]
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:repo)
                          op: assign_op.Equal
                          rhs: {($ Id.VSub_Number '$1')}
                          spids: [197]
                        )
                      ]
                    )
                    (C {<shift>})
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:ref)
                          op: assign_op.Equal
                          rhs: {($ Id.VSub_Number '$1')}
                          spids: [204]
                        )
                      ]
                    )
                    (command.Case
                      to_match: {(DQ ($ Id.VSub_DollarName '$ref'))}
                      arms: [
                        (case_arm
                          pat_list: [{<Id.Lit_Other '+'> <Id.Lit_Star '*'>}]
                          action: [
                            (command.ShAssignment
                              pairs: [
                                (assign_pair
                                  lhs: (sh_lhs_expr.Name name:ref)
                                  op: assign_op.Equal
                                  rhs: 
                                    {
                                      (command_sub
                                        left_token: <Id.Left_DollarParen '$('>
                                        child: 
                                          (C {<expr>} {(DQ <z> ($ Id.VSub_DollarName '$ref'))} 
                                            {<Id.Lit_Colon ':'>} {(SQ <'z+\\(.*\\)'>)}
                                          )
                                      )
                                    }
                                  spids: [230]
                                )
                              ]
                            )
                          ]
                          spids: [225 227 247 -1]
                        )
                      ]
                    )
                    (command.AndOr
                      ops: [Id.Op_DPipe]
                      children: [
                        (command.Simple
                          words: [
                            {<expr>}
                            {(DQ <z> ($ Id.VSub_DollarName '$ref'))}
                            {<Id.Lit_Colon ':'>}
                            {(SQ <'z.*:'>)}
                          ]
                          redirects: [
                            (redir
                              op: <Id.Redir_Great '>'>
                              loc: (redir_loc.Fd fd:1)
                              arg: {<'/dev/null'>}
                            )
                          ]
                          do_fork: T
                        )
                        (command.ShAssignment
                          pairs: [
                            (assign_pair
                              lhs: (sh_lhs_expr.Name name:ref)
                              op: assign_op.Equal
                              rhs: {(DQ (${ Id.VSub_Name ref) <':'>)}
                              spids: [271]
                            )
                          ]
                        )
                      ]
                    )
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:remote)
                          op: assign_op.Equal
                          rhs: 
                            {
                              (command_sub
                                left_token: <Id.Left_DollarParen '$('>
                                child: 
                                  (C {<expr>} {(DQ <z> ($ Id.VSub_DollarName '$ref'))} 
                                    {<Id.Lit_Colon ':'>} {(SQ <'z\\([^:]*\\):'>)}
                                  )
                              )
                            }
                          spids: [280]
                        )
                      ]
                    )
                    (command.Case
                      to_match: {(DQ ($ Id.VSub_DollarName '$remote'))}
                      arms: [
                        (case_arm
                          pat_list: [{(SQ )} {<HEAD>}]
                          action: [
                            (command.ShAssignment
                              pairs: [
                                (assign_pair
                                  lhs: (sh_lhs_expr.Name name:remote)
                                  op: assign_op.Equal
                                  rhs: {<HEAD>}
                                  spids: [315]
                                )
                              ]
                            )
                          ]
                          spids: [306 313 318 -1]
                        )
                        (case_arm
                          pat_list: [{<'heads/'> <Id.Lit_Star '*'>}]
                          action: [
                            (command.ShAssignment
                              pairs: [
                                (assign_pair
                                  lhs: (sh_lhs_expr.Name name:remote)
                                  op: assign_op.Equal
                                  rhs: 
                                    {
                                      (braced_var_sub
                                        token: <Id.VSub_Name remote>
                                        suffix_op: 
                                          (suffix_op.Unary
                                            op_id: Id.VOp1_Pound
                                            arg_word: {<heads> <Id.Lit_Slash '/'>}
                                          )
                                      )
                                    }
                                  spids: [325]
                                )
                              ]
                            )
                          ]
                          spids: [321 323 333 -1]
                        )
                        (case_arm
                          pat_list: [{<'refs/heads/'> <Id.Lit_Star '*'>}]
                          action: [
                            (command.ShAssignment
                              pairs: [
                                (assign_pair
                                  lhs: (sh_lhs_expr.Name name:remote)
                                  op: assign_op.Equal
                                  rhs: 
                                    {
                                      (braced_var_sub
                                        token: <Id.VSub_Name remote>
                                        suffix_op: 
                                          (suffix_op.Unary
                                            op_id: Id.VOp1_Pound
                                            arg_word: 
                                              {<refs> <Id.Lit_Slash '/'> <heads> <Id.Lit_Slash '/'>}
                                          )
                                      )
                                    }
                                  spids: [340]
                                )
                              ]
                            )
                          ]
                          spids: [336 338 350 -1]
                        )
                        (case_arm
                          pat_list: [
                            {<'refs/'> <Id.Lit_Star '*'>}
                            {<'tags/'> <Id.Lit_Star '*'>}
                            {<'remotes/'> <Id.Lit_Star '*'>}
                          ]
                          action: [
                            (command.ShAssignment
                              pairs: [
                                (assign_pair
                                  lhs: (sh_lhs_expr.Name name:remote)
                                  op: assign_op.Equal
                                  rhs: (word.Empty)
                                  spids: [368]
                                )
                              ]
                            )
                          ]
                          spids: [353 366 -1 371]
                        )
                      ]
                    )
                    (command.AndOr
                      ops: [Id.Op_DAmp]
                      children: [
                        (C {<Id.Lit_LBracket '['>} {<-n>} {(DQ ($ Id.VSub_DollarName '$remote'))} 
                          {<Id.Lit_RBracket ']'>}
                        )
                        (command.Case
                          to_match: {(DQ ($ Id.VSub_DollarName '$repo'))}
                          arms: [
                            (case_arm
                              pat_list: [{<.>}]
                              action: [
                                (C {<echo>} {(DQ <'refs/heads/'> ($ Id.VSub_DollarName '$remote'))})
                              ]
                              spids: [395 396 407 -1]
                            )
                            (case_arm
                              pat_list: [{<Id.Lit_Star '*'>}]
                              action: [
                                (C {<echo>} 
                                  {
                                    (DQ <'refs/remotes/'> ($ Id.VSub_DollarName '$repo') <'/'> 
                                      ($ Id.VSub_DollarName '$remote')
                                    )
                                  }
                                )
                              ]
                              spids: [410 411 424 -1]
                            )
                          ]
                        )
                      ]
                    )
                  ]
                  spids: [193 194 -1 430]
                )
              ]
            )
          ]
        )
    )
    (command.ShFunction
      name: error_on_missing_default_upstream
      body: 
        (BraceGroup
          children: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:cmd)
                  op: assign_op.Equal
                  rhs: {(DQ ($ Id.VSub_Number '$1'))}
                  spids: [443]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:op_type)
                  op: assign_op.Equal
                  rhs: {(DQ ($ Id.VSub_Number '$2'))}
                  spids: [449]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:op_prep)
                  op: assign_op.Equal
                  rhs: {(DQ ($ Id.VSub_Number '$3'))}
                  spids: [455]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:example)
                  op: assign_op.Equal
                  rhs: {(DQ ($ Id.VSub_Number '$4'))}
                  spids: [464]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:branch_name)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (command_sub
                        left_token: <Id.Left_DollarParen '$('>
                        child: (C {<git>} {<symbolic-ref>} {<-q>} {<HEAD>})
                      )
                    }
                  spids: [470]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:display_branch_name)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (DQ 
                        (braced_var_sub
                          token: <Id.VSub_Name branch_name>
                          suffix_op: 
                            (suffix_op.Unary
                              op_id: Id.VOp1_Pound
                              arg_word: {<refs> <Id.Lit_Slash '/'> <heads> <Id.Lit_Slash '/'>}
                            )
                        )
                      )
                    }
                  spids: [482]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:remote)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (DQ 
                        (command_sub
                          left_token: <Id.Left_DollarParen '$('>
                          child: (C {<gettext>} {(DQ <'<remote>'>)})
                        )
                      )
                    }
                  spids: [499]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:branch)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (DQ 
                        (command_sub
                          left_token: <Id.Left_DollarParen '$('>
                          child: (C {<gettext>} {(DQ <'<branch>'>)})
                        )
                      )
                    }
                  spids: [511]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (C {<test>} 
                      {
                        (command_sub
                          left_token: <Id.Left_DollarParen '$('>
                          child: 
                            (command.Pipeline
                              children: [(C {<git>} {<remote>}) (C {<wc>} {<-l>})]
                              negated: F
                            )
                        )
                      } {<Id.Lit_Equals '='>} {<1>}
                    )
                  ]
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:remote)
                          op: assign_op.Equal
                          rhs: 
                            {
                              (command_sub
                                left_token: <Id.Left_DollarParen '$('>
                                child: (C {<git>} {<remote>})
                              )
                            }
                          spids: [547]
                        )
                      ]
                    )
                  ]
                  spids: [523 544]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: [(C {<test>} {<-z>} {(DQ ($ Id.VSub_DollarName '$branch_name'))})]
                  action: [(C {<gettextln>} {(DQ <'You are not currently on a branch.'>)})]
                  spids: [559 570]
                )
              ]
              else_action: [
                (C {<gettextln>} {(DQ <'There is no tracking information for the current branch.'>)})
              ]
            )
            (command.Case
              to_match: {(DQ ($ Id.VSub_DollarName '$op_type'))}
              arms: [
                (case_arm
                  pat_list: [{<rebase>}]
                  action: [
                    (C {<gettextln>} {(DQ <'Please specify which branch you want to rebase against.'>)})
                  ]
                  spids: [602 603 613 -1]
                )
                (case_arm
                  pat_list: [{<merge>}]
                  action: [
                    (C {<gettextln>} {(DQ <'Please specify which branch you want to merge with.'>)})
                  ]
                  spids: [616 617 627 -1]
                )
                (case_arm
                  pat_list: [{<Id.Lit_Star '*'>}]
                  action: [
                    (command.Simple
                      words: [
                        {<echo>}
                        {(DQ <'BUG: unknown operation type: '> ($ Id.VSub_DollarName '$op_type'))}
                      ]
                      redirects: [(redir op:<Id.Redir_GreatAnd '>&'> loc:(redir_loc.Fd fd:1) arg:{<2>})]
                      do_fork: T
                    )
                    (command.ControlFlow
                      token: <Id.ControlFlow_Exit exit>
                      arg_word: {<1>}
                    )
                  ]
                  spids: [630 631 650 -1]
                )
              ]
            )
            (C {<eval_gettextln>} 
              {
                (DQ <'See git-'> (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\$'>) 
                  <'{cmd}(1) for details.'>
                )
              }
            )
            (C {<echo>})
            (C {<echo>} {(DQ <'    '> ($ Id.VSub_DollarName '$example'))})
            (C {<echo>})
            (command.If
              arms: [
                (if_arm
                  cond: [(C {<test>} {<-n>} {(DQ ($ Id.VSub_DollarName '$branch_name'))})]
                  action: [
                    (C {<gettextln>} 
                      {
                        (DQ 
                          <
'If you wish to set tracking information for this branch you can do so with:'
                          >
                        )
                      }
                    )
                    (C {<echo>})
                    (C {<echo>} 
                      {
                        (DQ <'    git branch --set-upstream-to='> ($ Id.VSub_DollarName '$remote') 
                          <'/'> ($ Id.VSub_DollarName '$branch') <' '> ($ Id.VSub_DollarName '$display_branch_name')
                        )
                      }
                    )
                    (C {<echo>})
                  ]
                  spids: [679 690]
                )
              ]
            )
            (command.ControlFlow token:<Id.ControlFlow_Exit exit> arg_word:{<1>})
          ]
        )
    )
  ]
)