(command.CommandList
  children: [
    (command.Sentence
      child: 
        (command.AndOr
          ops: [Id.Op_DPipe]
          children: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'GIT_DIR='> name:GIT_DIR)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (command_sub
                        left_token: <Id.Left_DollarParen '$('>
                        child: (C {<git>} {<rev-parse>} {<-q>} {<--git-dir>})
                        right: <Id.Eof_RParen _>
                      )
                    }
                  spids: [16]
                )
              ]
              redirects: []
            )
            (C {<Id.Lit_Colon ':'>})
          ]
        )
      terminator: <Id.Op_Semi _>
    )
    (command.ShFunction
      name: get_default_remote
      body: 
        (BraceGroup
          left: <Id.Lit_LBrace '{'>
          children: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'curr_branch='> name:curr_branch)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (command_sub
                        left_token: <Id.Left_DollarParen '$('>
                        child: (C {<git>} {<symbolic-ref>} {<-q>} {<HEAD>})
                        right: <Id.Eof_RParen _>
                      )
                    }
                  spids: [41]
                )
              ]
              redirects: []
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'curr_branch='> name:curr_branch)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (DQ 
                        (braced_var_sub
                          left: <Id.Left_DollarBrace '${'>
                          token: <Id.VSub_Name curr_branch>
                          var_name: curr_branch
                          suffix_op: 
                            (suffix_op.Unary
                              op: <Id.VOp1_Pound '#'>
                              arg_word: {<refs> <Id.Lit_Slash '/'> <heads> <Id.Lit_Slash '/'>}
                            )
                          right: <Id.Right_DollarBrace '}'>
                        )
                      )
                    }
                  spids: [53]
                )
              ]
              redirects: []
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'origin='> 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>)}
                          )
                        right: <Id.Eof_RParen _>
                      )
                    }
                  spids: [66]
                )
              ]
              redirects: []
            )
            (C {<echo>} 
              {
                (braced_var_sub
                  left: <Id.Left_DollarBrace '${'>
                  token: <Id.VSub_Name origin>
                  var_name: origin
                  suffix_op: (suffix_op.Unary op:<Id.VTest_ColonHyphen _> arg_word:{<origin>})
                  right: <Id.Right_DollarBrace '}'>
                )
              }
            )
          ]
          redirects: []
          right: <Id.Lit_RBrace '}'>
        )
    )
    (command.ShFunction
      name: get_remote_merge_branch
      body: 
        (BraceGroup
          left: <Id.Lit_LBrace '{'>
          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 left:<Id.Lit_VarLike 'origin='> name:origin)
                          op: assign_op.Equal
                          rhs: {(DQ ($ Id.VSub_Number 1))}
                          spids: [116]
                        )
                      ]
                      redirects: []
                    )
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'default='> name:default)
                          op: assign_op.Equal
                          rhs: 
                            {
                              (command_sub
                                left_token: <Id.Left_DollarParen '$('>
                                child: (C {<get_default_remote>})
                                right: <Id.Eof_RParen _>
                              )
                            }
                          spids: [122]
                        )
                      ]
                      redirects: []
                    )
                    (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 left:<Id.Lit_VarLike 'origin='> name:origin)
                              op: assign_op.Equal
                              rhs: {($ Id.VSub_DollarName default)}
                              spids: [138]
                            )
                          ]
                          redirects: []
                        )
                      ]
                    )
                    (command.AndOr
                      ops: [Id.Op_DAmp Id.Op_DAmp]
                      children: [
                        (command.ShAssignment
                          pairs: [
                            (assign_pair
                              lhs: 
                                (sh_lhs_expr.Name
                                  left: <Id.Lit_VarLike 'curr_branch='>
                                  name: curr_branch
                                )
                              op: assign_op.Equal
                              rhs: 
                                {
                                  (command_sub
                                    left_token: <Id.Left_DollarParen '$('>
                                    child: (C {<git>} {<symbolic-ref>} {<-q>} {<HEAD>})
                                    right: <Id.Eof_RParen _>
                                  )
                                }
                              spids: [142]
                            )
                          ]
                          redirects: []
                        )
                        (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)}
                                )
                              right: <Id.Eof_RParen _>
                            )
                          }
                        )
                      ]
                    )
                  ]
                  spids: [110 113 190 -1]
                )
                (case_arm
                  pat_list: [{<Id.Lit_Star '*'>}]
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'repo='> name:repo)
                          op: assign_op.Equal
                          rhs: {($ Id.VSub_Number 1)}
                          spids: [197]
                        )
                      ]
                      redirects: []
                    )
                    (C {<shift>})
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'ref='> name:ref)
                          op: assign_op.Equal
                          rhs: {($ Id.VSub_Number 1)}
                          spids: [204]
                        )
                      ]
                      redirects: []
                    )
                    (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 left:<Id.Lit_VarLike 'ref='> 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+\\(.*\\)'>)}
                                          )
                                        right: <Id.Eof_RParen _>
                                      )
                                    }
                                  spids: [230]
                                )
                              ]
                              redirects: []
                            )
                          ]
                          spids: [225 227 247 -1]
                        )
                      ]
                      redirects: []
                    )
                    (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'>}
                            )
                          ]
                          more_env: []
                          do_fork: T
                        )
                        (command.ShAssignment
                          pairs: [
                            (assign_pair
                              lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'ref='> name:ref)
                              op: assign_op.Equal
                              rhs: {(DQ (${ Id.VSub_Name ref) <':'>)}
                              spids: [271]
                            )
                          ]
                          redirects: []
                        )
                      ]
                    )
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'remote='> 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\\([^:]*\\):'>)}
                                  )
                                right: <Id.Eof_RParen _>
                              )
                            }
                          spids: [280]
                        )
                      ]
                      redirects: []
                    )
                    (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 left:<Id.Lit_VarLike 'remote='> name:remote)
                                  op: assign_op.Equal
                                  rhs: {<HEAD>}
                                  spids: [315]
                                )
                              ]
                              redirects: []
                            )
                          ]
                          spids: [306 313 318 -1]
                        )
                        (case_arm
                          pat_list: [{<'heads/'> <Id.Lit_Star '*'>}]
                          action: [
                            (command.ShAssignment
                              pairs: [
                                (assign_pair
                                  lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'remote='> name:remote)
                                  op: assign_op.Equal
                                  rhs: 
                                    {
                                      (braced_var_sub
                                        left: <Id.Left_DollarBrace '${'>
                                        token: <Id.VSub_Name remote>
                                        var_name: remote
                                        suffix_op: 
                                          (suffix_op.Unary
                                            op: <Id.VOp1_Pound '#'>
                                            arg_word: {<heads> <Id.Lit_Slash '/'>}
                                          )
                                        right: <Id.Right_DollarBrace '}'>
                                      )
                                    }
                                  spids: [325]
                                )
                              ]
                              redirects: []
                            )
                          ]
                          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 left:<Id.Lit_VarLike 'remote='> name:remote)
                                  op: assign_op.Equal
                                  rhs: 
                                    {
                                      (braced_var_sub
                                        left: <Id.Left_DollarBrace '${'>
                                        token: <Id.VSub_Name remote>
                                        var_name: remote
                                        suffix_op: 
                                          (suffix_op.Unary
                                            op: <Id.VOp1_Pound '#'>
                                            arg_word: 
                                              {<refs> <Id.Lit_Slash '/'> <heads> <Id.Lit_Slash '/'>}
                                          )
                                        right: <Id.Right_DollarBrace '}'>
                                      )
                                    }
                                  spids: [340]
                                )
                              ]
                              redirects: []
                            )
                          ]
                          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 left:<Id.Lit_VarLike 'remote='> name:remote)
                                  op: assign_op.Equal
                                  rhs: (rhs_word.Empty)
                                  spids: [368]
                                )
                              ]
                              redirects: []
                            )
                          ]
                          spids: [353 366 -1 371]
                        )
                      ]
                      redirects: []
                    )
                    (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]
                            )
                          ]
                          redirects: []
                        )
                      ]
                    )
                  ]
                  spids: [193 194 -1 430]
                )
              ]
              redirects: []
            )
          ]
          redirects: []
          right: <Id.Lit_RBrace '}'>
        )
    )
    (command.ShFunction
      name: error_on_missing_default_upstream
      body: 
        (BraceGroup
          left: <Id.Lit_LBrace '{'>
          children: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'cmd='> name:cmd)
                  op: assign_op.Equal
                  rhs: {(DQ ($ Id.VSub_Number 1))}
                  spids: [443]
                )
              ]
              redirects: []
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'op_type='> name:op_type)
                  op: assign_op.Equal
                  rhs: {(DQ ($ Id.VSub_Number 2))}
                  spids: [449]
                )
              ]
              redirects: []
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'op_prep='> name:op_prep)
                  op: assign_op.Equal
                  rhs: {(DQ ($ Id.VSub_Number 3))}
                  spids: [455]
                )
              ]
              redirects: []
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'example='> name:example)
                  op: assign_op.Equal
                  rhs: {(DQ ($ Id.VSub_Number 4))}
                  spids: [464]
                )
              ]
              redirects: []
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'branch_name='> name:branch_name)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (command_sub
                        left_token: <Id.Left_DollarParen '$('>
                        child: (C {<git>} {<symbolic-ref>} {<-q>} {<HEAD>})
                        right: <Id.Eof_RParen _>
                      )
                    }
                  spids: [470]
                )
              ]
              redirects: []
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: 
                    (sh_lhs_expr.Name
                      left: <Id.Lit_VarLike 'display_branch_name='>
                      name: display_branch_name
                    )
                  op: assign_op.Equal
                  rhs: 
                    {
                      (DQ 
                        (braced_var_sub
                          left: <Id.Left_DollarBrace '${'>
                          token: <Id.VSub_Name branch_name>
                          var_name: branch_name
                          suffix_op: 
                            (suffix_op.Unary
                              op: <Id.VOp1_Pound '#'>
                              arg_word: {<refs> <Id.Lit_Slash '/'> <heads> <Id.Lit_Slash '/'>}
                            )
                          right: <Id.Right_DollarBrace '}'>
                        )
                      )
                    }
                  spids: [482]
                )
              ]
              redirects: []
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'remote='> name:remote)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (DQ 
                        (command_sub
                          left_token: <Id.Left_DollarParen '$('>
                          child: (C {<gettext>} {(DQ <'<remote>'>)})
                          right: <Id.Eof_RParen _>
                        )
                      )
                    }
                  spids: [499]
                )
              ]
              redirects: []
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'branch='> name:branch)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (DQ 
                        (command_sub
                          left_token: <Id.Left_DollarParen '$('>
                          child: (C {<gettext>} {(DQ <'<branch>'>)})
                          right: <Id.Eof_RParen _>
                        )
                      )
                    }
                  spids: [511]
                )
              ]
              redirects: []
            )
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (C {<test>} 
                          {
                            (command_sub
                              left_token: <Id.Left_DollarParen '$('>
                              child: 
                                (command.Pipeline
                                  children: [(C {<git>} {<remote>}) (C {<wc>} {<-l>})]
                                  negated: F
                                  stderr_indices: []
                                )
                              right: <Id.Eof_RParen _>
                            )
                          } {<Id.Lit_Equals '='>} {<1>}
                        )
                      ]
                    )
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'remote='> name:remote)
                          op: assign_op.Equal
                          rhs: 
                            {
                              (command_sub
                                left_token: <Id.Left_DollarParen '$('>
                                child: (C {<git>} {<remote>})
                                right: <Id.Eof_RParen _>
                              )
                            }
                          spids: [547]
                        )
                      ]
                      redirects: []
                    )
                  ]
                  spids: [523 544]
                )
              ]
              else_action: []
              redirects: []
            )
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [(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.'>)})
              ]
              redirects: []
            )
            (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>})]
                      more_env: []
                      do_fork: T
                    )
                    (command.ControlFlow
                      token: <Id.ControlFlow_Exit exit>
                      arg_word: {<1>}
                    )
                  ]
                  spids: [630 631 650 -1]
                )
              ]
              redirects: []
            )
            (C {<eval_gettextln>} 
              {
                (DQ <'See git-'> (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\$'> ch:'$') 
                  <'{cmd}(1) for details.'>
                )
              }
            )
            (C {<echo>})
            (C {<echo>} {(DQ <'    '> ($ Id.VSub_DollarName example))})
            (C {<echo>})
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [(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]
                )
              ]
              else_action: []
              redirects: []
            )
            (command.ControlFlow token:<Id.ControlFlow_Exit exit> arg_word:{<1>})
          ]
          redirects: []
          right: <Id.Lit_RBrace '}'>
        )
    )
  ]
)