(command.CommandList
  children: [
    (command.Assignment
      keyword: Assign_None
      pairs: [(assign_pair lhs:(lhs_expr.LhsName name:OPTIONS_KEEPDASHDASH) op:Equal rhs:{(t)})]
    )
    (command.Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (lhs_expr.LhsName name:OPTIONS_SPEC)
          op: Equal
          rhs: 
            {
              (DQ ('git-checkout [options] [<branch>] [<paths>...]\n') ('--\n') 
                ('b=          create a new branch started at <branch>\n') ("l           create the new branch's reflog\n") 
                ('track       arrange that the new branch tracks the remote branch\n') ('f           proceed even if the index or working tree is not HEAD\n') 
                ('m           merge local modifications into the new branch\n') ('q,quiet     be quiet\n')
              )
            }
        )
      ]
    )
    (command.Assignment
      keyword: Assign_None
      pairs: [(assign_pair lhs:(lhs_expr.LhsName name:SUBDIRECTORY_OK) op:Equal rhs:{(Sometimes)})]
    )
    (C {(.)} {(git-sh-setup)})
    (C {(require_work_tree)})
    (command.Assignment
      keyword: Assign_None
      pairs: [(assign_pair lhs:(lhs_expr.LhsName name:old_name) op:Equal rhs:{(HEAD)})]
    )
    (command.Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (lhs_expr.LhsName name:old)
          op: Equal
          rhs: 
            {
              (word_part.CommandSubPart
                command_list: 
                  (command.CommandList
                    children: [
                      (command.SimpleCommand
                        words: [{(git)} {(rev-parse)} {(--verify)} {($ VSub_DollarName '$old_name')}]
                        redirects: [(redir.Redir op:<Redir_Great '2>'> fd:2 arg_word:{(/dev/null)})]
                      )
                    ]
                  )
                left_token: <Left_CommandSub '$('>
              )
            }
        )
      ]
    )
    (command.Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (lhs_expr.LhsName name:oldbranch)
          op: Equal
          rhs: 
            {
              (word_part.CommandSubPart
                command_list: 
                  (command.CommandList
                    children: [
                      (command.SimpleCommand
                        words: [{(git)} {(symbolic-ref)} {($ VSub_DollarName '$old_name')}]
                        redirects: [(redir.Redir op:<Redir_Great '2>'> fd:2 arg_word:{(/dev/null)})]
                      )
                    ]
                  )
                left_token: <Left_CommandSub '$('>
              )
            }
        )
      ]
    )
    (command.Assignment
      keyword: Assign_None
      pairs: [(assign_pair lhs:(lhs_expr.LhsName name:new) op:Equal rhs:(word.EmptyWord))]
    )
    (command.Assignment
      keyword: Assign_None
      pairs: [(assign_pair lhs:(lhs_expr.LhsName name:new_name) op:Equal rhs:(word.EmptyWord))]
    )
    (command.Assignment
      keyword: Assign_None
      pairs: [(assign_pair lhs:(lhs_expr.LhsName name:force) op:Equal rhs:(word.EmptyWord))]
    )
    (command.Assignment
      keyword: Assign_None
      pairs: [(assign_pair lhs:(lhs_expr.LhsName name:branch) op:Equal rhs:(word.EmptyWord))]
    )
    (command.Assignment
      keyword: Assign_None
      pairs: [(assign_pair lhs:(lhs_expr.LhsName name:track) op:Equal rhs:(word.EmptyWord))]
    )
    (command.Assignment
      keyword: Assign_None
      pairs: [(assign_pair lhs:(lhs_expr.LhsName name:newbranch) op:Equal rhs:(word.EmptyWord))]
    )
    (command.Assignment
      keyword: Assign_None
      pairs: [(assign_pair lhs:(lhs_expr.LhsName name:newbranch_log) op:Equal rhs:(word.EmptyWord))]
    )
    (command.Assignment
      keyword: Assign_None
      pairs: [(assign_pair lhs:(lhs_expr.LhsName name:merge) op:Equal rhs:(word.EmptyWord))]
    )
    (command.Assignment
      keyword: Assign_None
      pairs: [(assign_pair lhs:(lhs_expr.LhsName name:quiet) op:Equal rhs:(word.EmptyWord))]
    )
    (command.Assignment
      keyword: Assign_None
      pairs: [(assign_pair lhs:(lhs_expr.LhsName name:v) op:Equal rhs:{(-v)})]
    )
    (command.Assignment
      keyword: Assign_None
      pairs: [(assign_pair lhs:(lhs_expr.LhsName name:LF) op:Equal rhs:{(SQ <'\n'>)})]
    )
    (command.WhileUntil
      keyword: <KW_While while>
      cond: [
        (command.Sentence
          child: (C {(test)} {($ VSub_Pound '$#')} {(KW_Bang '!') (Lit_Other '=')} {(0)})
          terminator: <Op_Semi ';'>
        )
      ]
      body: 
        (command.DoGroup
          children: [
            (command.Case
              to_match: {(DQ ($ VSub_Number '$1'))}
              arms: [
                (case_arm
                  pat_list: [{(-b)}]
                  action: [
                    (C {(shift)})
                    (command.Assignment
                      keyword: Assign_None
                      pairs: [
                        (assign_pair
                          lhs: (lhs_expr.LhsName name:newbranch)
                          op: Equal
                          rhs: {(DQ ($ VSub_Number '$1'))}
                        )
                      ]
                    )
                    (command.AndOr
                      ops: [Op_DAmp]
                      children: [
                        (C {(Lit_Other '[')} {(-z)} {(DQ ($ VSub_DollarName '$newbranch'))} 
                          {(Lit_Other ']')}
                        )
                        (C {(die)} {(DQ ('git checkout: -b needs a branch name'))})
                      ]
                    )
                    (command.AndOr
                      ops: [Op_DAmp]
                      children: [
                        (C {(git)} {(show-ref)} {(--verify)} {(--quiet)} {(--)} 
                          {(DQ (refs/heads/) ($ VSub_DollarName '$newbranch'))}
                        )
                        (C {(die)} 
                          {
                            (DQ ('git checkout: branch ') ($ VSub_DollarName '$newbranch') 
                              (' already exists')
                            )
                          }
                        )
                      ]
                    )
                    (command.AndOr
                      ops: [Op_DPipe]
                      children: [
                        (C {(git)} {(check-ref-format)} {(DQ (heads/) ($ VSub_DollarName '$newbranch'))})
                        (C {(die)} 
                          {
                            (DQ ("git checkout: we do not like '") ($ VSub_DollarName '$newbranch') 
                              ("' as a branch name.")
                            )
                          }
                        )
                      ]
                    )
                  ]
                )
                (case_arm
                  pat_list: [{(-l)}]
                  action: [
                    (command.Assignment
                      keyword: Assign_None
                      pairs: [
                        (assign_pair
                          lhs: (lhs_expr.LhsName name:newbranch_log)
                          op: Equal
                          rhs: {(-l)}
                        )
                      ]
                    )
                  ]
                )
                (case_arm
                  pat_list: [{(--track)} {(--no-track)}]
                  action: [
                    (command.Assignment
                      keyword: Assign_None
                      pairs: [
                        (assign_pair
                          lhs: (lhs_expr.LhsName name:track)
                          op: Equal
                          rhs: {(DQ ($ VSub_Number '$1'))}
                        )
                      ]
                    )
                  ]
                )
                (case_arm
                  pat_list: [{(-f)}]
                  action: [
                    (command.Assignment
                      keyword: Assign_None
                      pairs: [(assign_pair lhs:(lhs_expr.LhsName name:force) op:Equal rhs:{(1)})]
                    )
                  ]
                )
                (case_arm
                  pat_list: [{(-m)}]
                  action: [
                    (command.Assignment
                      keyword: Assign_None
                      pairs: [(assign_pair lhs:(lhs_expr.LhsName name:merge) op:Equal rhs:{(1)})]
                    )
                  ]
                )
                (case_arm
                  pat_list: [{(-q)} {(--quiet)}]
                  action: [
                    (command.Assignment
                      keyword: Assign_None
                      pairs: [(assign_pair lhs:(lhs_expr.LhsName name:quiet) op:Equal rhs:{(1)})]
                    )
                    (command.Assignment
                      keyword: Assign_None
                      pairs: [(assign_pair lhs:(lhs_expr.LhsName name:v) op:Equal rhs:(word.EmptyWord))]
                    )
                  ]
                )
                (case_arm
                  pat_list: [{(--)}]
                  action: [(C {(shift)}) (command.ControlFlow token:<ControlFlow_Break break>)]
                )
                (case_arm pat_list:[{(Lit_Other '*')}] action:[(C {(usage)})])
              ]
            )
            (C {(shift)})
          ]
        )
    )
    (command.Assignment
      keyword: Assign_None
      pairs: [(assign_pair lhs:(lhs_expr.LhsName name:arg) op:Equal rhs:{(DQ ($ VSub_Number '$1'))})]
    )
    (command.Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (lhs_expr.LhsName name:rev)
          op: Equal
          rhs: 
            {
              (word_part.CommandSubPart
                command_list: 
                  (command.CommandList
                    children: [
                      (command.SimpleCommand
                        words: [{(git)} {(rev-parse)} {(--verify)} {(DQ ($ VSub_DollarName '$arg'))}]
                        redirects: [(redir.Redir op:<Redir_Great '2>'> fd:2 arg_word:{(/dev/null)})]
                      )
                    ]
                  )
                left_token: <Left_CommandSub '$('>
              )
            }
        )
      ]
    )
    (command.If
      arms: [
        (if_arm
          cond: [
            (command.Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (lhs_expr.LhsName name:rev)
                  op: Equal
                  rhs: 
                    {
                      (word_part.CommandSubPart
                        command_list: 
                          (command.CommandList
                            children: [
                              (command.SimpleCommand
                                words: [
                                  {(git)}
                                  {(rev-parse)}
                                  {(--verify)}
                                  {(DQ ($ VSub_DollarName '$rev') ('^0'))}
                                ]
                                redirects: [
                                  (redir.Redir
                                    op: <Redir_Great '2>'>
                                    fd: 2
                                    arg_word: {(/dev/null)}
                                  )
                                ]
                              )
                            ]
                          )
                        left_token: <Left_CommandSub '$('>
                      )
                    }
                )
              ]
            )
          ]
          action: [
            (command.AndOr
              ops: [Op_DAmp]
              children: [
                (C {(Lit_Other '[')} {(-z)} {(DQ ($ VSub_DollarName '$rev'))} {(Lit_Other ']')})
                (C {(die)} {(DQ ('unknown flag ') ($ VSub_DollarName '$arg'))})
              ]
            )
            (command.Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (lhs_expr.LhsName name:new_name)
                  op: Equal
                  rhs: {(DQ ($ VSub_DollarName '$arg'))}
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (C {(git)} {(show-ref)} {(--verify)} {(--quiet)} {(--)} 
                      {(DQ (refs/heads/) ($ VSub_DollarName '$arg'))}
                    )
                  ]
                  action: [
                    (command.Assignment
                      keyword: Assign_None
                      pairs: [
                        (assign_pair
                          lhs: (lhs_expr.LhsName name:rev)
                          op: Equal
                          rhs: 
                            {
                              (word_part.CommandSubPart
                                command_list: 
                                  (command.CommandList
                                    children: [
                                      (C {(git)} {(rev-parse)} {(--verify)} 
                                        {(DQ (refs/heads/) ($ VSub_DollarName '$arg') ('^0'))}
                                      )
                                    ]
                                  )
                                left_token: <Left_CommandSub '$('>
                              )
                            }
                        )
                      ]
                    )
                    (command.Assignment
                      keyword: Assign_None
                      pairs: [
                        (assign_pair
                          lhs: (lhs_expr.LhsName name:branch)
                          op: Equal
                          rhs: {(DQ ($ VSub_DollarName '$arg'))}
                        )
                      ]
                    )
                  ]
                )
              ]
            )
            (command.Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (lhs_expr.LhsName name:new)
                  op: Equal
                  rhs: {(DQ ($ VSub_DollarName '$rev'))}
                )
              ]
            )
            (C {(shift)})
          ]
        )
        (if_arm
          cond: [
            (command.Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (lhs_expr.LhsName name:rev)
                  op: Equal
                  rhs: 
                    {
                      (word_part.CommandSubPart
                        command_list: 
                          (command.CommandList
                            children: [
                              (command.SimpleCommand
                                words: [
                                  {(git)}
                                  {(rev-parse)}
                                  {(--verify)}
                                  {(DQ ($ VSub_DollarName '$rev') ('^{tree}'))}
                                ]
                                redirects: [
                                  (redir.Redir
                                    op: <Redir_Great '2>'>
                                    fd: 2
                                    arg_word: {(/dev/null)}
                                  )
                                ]
                              )
                            ]
                          )
                        left_token: <Left_CommandSub '$('>
                      )
                    }
                )
              ]
            )
          ]
          action: [
            (command.Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (lhs_expr.LhsName name:new)
                  op: Equal
                  rhs: {(DQ ($ VSub_DollarName '$rev'))}
                )
              ]
            )
            (command.Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (lhs_expr.LhsName name:new_name)
                  op: Equal
                  rhs: {(DQ ($ VSub_DollarName '$rev') ('^{tree}'))}
                )
              ]
            )
            (C {(shift)})
          ]
        )
      ]
    )
    (command.AndOr
      ops: [Op_DAmp]
      children: [
        (C {(Lit_Other '[')} {(DQ ($ VSub_Number '$1'))} {(Lit_Other '=')} {(DQ (--))} {(Lit_Other ']')})
        (C {(shift)})
      ]
    )
    (command.Case
      to_match: {(DQ ($ VSub_DollarName '$newbranch') (',') ($ VSub_DollarName '$track'))}
      arms: [
        (case_arm
          pat_list: [{(Lit_Comma ',') (--) (Lit_Other '*')}]
          action: [(C {(die)} {(DQ ('git checkout: --track and --no-track require -b'))})]
        )
      ]
    )
    (command.Case
      to_match: {(DQ ($ VSub_DollarName '$force') ($ VSub_DollarName '$merge'))}
      arms: [
        (case_arm
          pat_list: [{(11)}]
          action: [(C {(die)} {(DQ ('git checkout: -f and -m are incompatible'))})]
        )
      ]
    )
    (command.If
      arms: [
        (if_arm
          cond: [(C {(test)} {(DQ ($ VSub_Pound '$#'))} {(-ge)} {(1)})]
          action: [
            (command.Assignment
              keyword: Assign_None
              pairs: [(assign_pair lhs:(lhs_expr.LhsName name:hint) op:Equal rhs:(word.EmptyWord))]
            )
            (command.If
              arms: [
                (if_arm
                  cond: [(C {(test)} {(DQ ($ VSub_Pound '$#'))} {(-eq)} {(1)})]
                  action: [
                    (command.Assignment
                      keyword: Assign_None
                      pairs: [
                        (assign_pair
                          lhs: (lhs_expr.LhsName name:hint)
                          op: Equal
                          rhs: 
                            {
                              (DQ ('\n') ("Did you intend to checkout '") ($ VSub_At '$@') 
                                ("' which can not be resolved as commit?")
                              )
                            }
                        )
                      ]
                    )
                  ]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (C {(test)} {(SQ )} {(KW_Bang '!') (Lit_Other '=')} 
                      {
                        (DQ ($ VSub_DollarName '$newbranch') ($ VSub_DollarName '$force') 
                          ($ VSub_DollarName '$merge')
                        )
                      }
                    )
                  ]
                  action: [
                    (C {(die)} 
                      {
                        (DQ 
                          (
'git checkout: updating paths is incompatible with switching branches/forcing'
                          ) ($ VSub_DollarName '$hint')
                        )
                      }
                    )
                  ]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (C {(test)} {(SQ )} {(KW_Bang '!') (Lit_Other '=')} {(DQ ($ VSub_DollarName '$new'))})
                  ]
                  action: [
                    (command.AndOr
                      ops: [Op_DPipe]
                      children: [
                        (command.Pipeline
                          children: [
                            (C {(git)} {(ls-tree)} {(--full-name)} {(-r)} {(DQ ($ VSub_DollarName '$new'))} 
                              {(DQ ($ VSub_At '$@'))}
                            )
                            (C {(git)} {(update-index)} {(--index-info)})
                          ]
                          negated: F
                        )
                        (command.ControlFlow
                          token: <ControlFlow_Exit exit>
                          arg_word: {($ VSub_QMark '$?')}
                        )
                      ]
                    )
                  ]
                )
              ]
            )
            (command.AndOr
              ops: [Op_DPipe]
              children: [
                (command.SimpleCommand
                  words: [
                    {(git)}
                    {(ls-files)}
                    {(--full-name)}
                    {(--error-unmatch)}
                    {(--)}
                    {(DQ ($ VSub_At '$@'))}
                  ]
                  redirects: [(redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(/dev/null)})]
                )
                (command.ControlFlow token:<ControlFlow_Exit exit>)
              ]
            )
            (command.Pipeline
              children: [
                (C {(git)} {(ls-files)} {(--full-name)} {(--)} {(DQ ($ VSub_At '$@'))})
                (command.Subshell
                  command_list: 
                    (command.CommandList
                      children: [
                        (command.AndOr
                          ops: [Op_DAmp]
                          children: [
                            (C {(cd_to_toplevel)})
                            (C {(git)} {(checkout-index)} {(-f)} {(-u)} {(--stdin)})
                          ]
                        )
                      ]
                    )
                )
              ]
              negated: F
            )
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (C {(test)} {(-x)} {(DQ ($ VSub_DollarName '$GIT_DIR')) (/hooks/post-checkout)})
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [
                    (C {(DQ ($ VSub_DollarName '$GIT_DIR')) (/hooks/post-checkout)} 
                      {($ VSub_DollarName '$old')} {($ VSub_DollarName '$old')} {(0)}
                    )
                  ]
                )
              ]
            )
            (command.ControlFlow
              token: <ControlFlow_Exit exit>
              arg_word: {($ VSub_QMark '$?')}
            )
          ]
        )
      ]
      else_action: [
        (command.If
          arms: [
            (if_arm
              cond: [
                (C {(test)} {(SQ )} {(KW_Bang '!') (Lit_Other '=')} {(DQ ($ VSub_DollarName '$new'))})
              ]
              action: [
                (command.AndOr
                  ops: [Op_DPipe]
                  children: [
                    (command.SimpleCommand
                      words: [
                        {(git)}
                        {(rev-parse)}
                        {(--verify)}
                        {(DQ ($ VSub_DollarName '$new') ('^{commit}'))}
                      ]
                      redirects: [
                        (redir.Redir
                          op: <Redir_Great '>'>
                          fd: 16777215
                          arg_word: {(/dev/null)}
                        )
                        (redir.Redir
                          op: <Redir_GreatAnd '2>&'>
                          fd: 2
                          arg_word: {(1)}
                        )
                      ]
                    )
                    (C {(die)} {(DQ ('Cannot switch branch to a non-commit.'))})
                  ]
                )
              ]
            )
          ]
        )
      ]
    )
    (C {(cd_to_toplevel)})
    (command.AndOr
      ops: [Op_DAmp Op_DAmp]
      children: [
        (C {(Lit_Other '[')} {(-z)} {(DQ ($ VSub_DollarName '$new'))} {(Lit_Other ']')})
        (command.Assignment
          keyword: Assign_None
          pairs: [
            (assign_pair
              lhs: (lhs_expr.LhsName name:new)
              op: Equal
              rhs: {($ VSub_DollarName '$old')}
            )
          ]
        )
        (command.Assignment
          keyword: Assign_None
          pairs: [
            (assign_pair
              lhs: (lhs_expr.LhsName name:new_name)
              op: Equal
              rhs: {(DQ ($ VSub_DollarName '$old_name'))}
            )
          ]
        )
      ]
    )
    (command.Assignment
      keyword: Assign_None
      pairs: [(assign_pair lhs:(lhs_expr.LhsName name:detached) op:Equal rhs:(word.EmptyWord))]
    )
    (command.Assignment
      keyword: Assign_None
      pairs: [(assign_pair lhs:(lhs_expr.LhsName name:detach_warn) op:Equal rhs:(word.EmptyWord))]
    )
    (command.FuncDef
      name: describe_detached_head
      body: 
        (command.BraceGroup
          children: [
            (command.AndOr
              ops: [Op_DPipe]
              children: [
                (C {(test)} {(-n)} {(DQ ($ VSub_DollarName '$quiet'))})
                (command.BraceGroup
                  children: [
                    (command.SimpleCommand
                      words: [{(printf)} {(DQ ($ VSub_Number '$1') (' '))}]
                      redirects: [(redir.Redir op:<Redir_GreatAnd '>&'> fd:16777215 arg_word:{(2)})]
                    )
                    (command.SimpleCommand
                      words: [
                        {(git)}
                        {(log)}
                        {(-1)}
                        {(--pretty) (Lit_Other '=') (oneline)}
                        {(--abbrev-commit)}
                        {(DQ ($ VSub_Number '$2'))}
                        {(--)}
                      ]
                      redirects: [(redir.Redir op:<Redir_GreatAnd '>&'> fd:16777215 arg_word:{(2)})]
                      more_env: [(env_pair name:GIT_PAGER val:(word.EmptyWord))]
                    )
                  ]
                )
              ]
            )
          ]
        )
    )
    (command.If
      arms: [
        (if_arm
          cond: [
            (command.AndOr
              ops: [Op_DAmp]
              children: [
                (C {(test)} {(-z)} {(DQ ($ VSub_DollarName '$branch') ($ VSub_DollarName '$newbranch'))})
                (C {(test)} {(DQ ($ VSub_DollarName '$new_name'))} {(KW_Bang '!') (Lit_Other '=')} 
                  {(DQ ($ VSub_DollarName '$old_name'))}
                )
              ]
            )
          ]
          action: [
            (command.Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (lhs_expr.LhsName name:detached)
                  op: Equal
                  rhs: {(DQ ($ VSub_DollarName '$new'))}
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.AndOr
                      ops: [Op_DAmp]
                      children: [
                        (C {(test)} {(-n)} {(DQ ($ VSub_DollarName '$oldbranch'))})
                        (C {(test)} {(-z)} {(DQ ($ VSub_DollarName '$quiet'))})
                      ]
                    )
                  ]
                  action: [
                    (command.Assignment
                      keyword: Assign_None
                      pairs: [
                        (assign_pair
                          lhs: (lhs_expr.LhsName name:detach_warn)
                          op: Equal
                          rhs: 
                            {
                              (DQ ('Note: moving to ') 
                                (word_part.EscapedLiteralPart
                                  token: <Lit_EscapedChar '\\"'>
                                ) ($ VSub_DollarName '$new_name') (word_part.EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) 
                                (" which isn't a local branch\n") ('If you want to create a new branch from this checkout, you may do so\n') 
                                (
'(now or later) by using -b with the checkout command again. Example:\n'
                                ) ('  git checkout -b <new_branch_name>')
                              )
                            }
                        )
                      ]
                    )
                  ]
                )
              ]
            )
          ]
        )
        (if_arm
          cond: [
            (command.AndOr
              ops: [Op_DAmp]
              children: [
                (C {(test)} {(-z)} {(DQ ($ VSub_DollarName '$oldbranch'))})
                (C {(test)} {(DQ ($ VSub_DollarName '$new'))} {(KW_Bang '!') (Lit_Other '=')} 
                  {(DQ ($ VSub_DollarName '$old'))}
                )
              ]
            )
          ]
          action: [
            (C {(describe_detached_head)} {(SQ <'Previous HEAD position was'>)} 
              {(DQ ($ VSub_DollarName '$old'))}
            )
          ]
        )
      ]
    )
    (command.If
      arms: [
        (if_arm
          cond: [
            (C {(Lit_Other '[')} {(DQ (X) ($ VSub_DollarName '$old'))} {(Lit_Other '=')} {(X)} 
              {(Lit_Other ']')}
            )
          ]
          action: [
            (command.If
              arms: [
                (if_arm
                  cond: [(C {(test)} {(-z)} {(DQ ($ VSub_DollarName '$quiet'))})]
                  action: [
                    (command.SimpleCommand
                      words: [{(echo)} {(DQ ('warning: You appear to be on a branch yet to be born.'))}]
                      redirects: [(redir.Redir op:<Redir_GreatAnd '>&'> fd:16777215 arg_word:{(2)})]
                    )
                    (command.SimpleCommand
                      words: [
                        {(echo)}
                        {(DQ ('warning: Forcing checkout of ') ($ VSub_DollarName '$new_name') (.))}
                      ]
                      redirects: [(redir.Redir op:<Redir_GreatAnd '>&'> fd:16777215 arg_word:{(2)})]
                    )
                  ]
                )
              ]
            )
            (command.Assignment
              keyword: Assign_None
              pairs: [(assign_pair lhs:(lhs_expr.LhsName name:force) op:Equal rhs:{(1)})]
            )
          ]
        )
      ]
    )
    (command.If
      arms: [
        (if_arm
          cond: [(C {(Lit_Other '[')} {(DQ ($ VSub_DollarName '$force'))} {(Lit_Other ']')})]
          action: [
            (C {(git)} {(read-tree)} {($ VSub_DollarName '$v')} {(--reset)} {(-u)} 
              {($ VSub_DollarName '$new')}
            )
          ]
        )
      ]
      else_action: [
        (command.SimpleCommand
          words: [{(git)} {(update-index)} {(--refresh)}]
          redirects: [(redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(/dev/null)})]
        )
        (command.AndOr
          ops: [Op_DPipe]
          children: [
            (C {(git)} {(read-tree)} {($ VSub_DollarName '$v')} {(-m)} {(-u)} 
              {(--exclude-per-directory) (Lit_Other '=') (.gitignore)} {($ VSub_DollarName '$old')} {($ VSub_DollarName '$new')}
            )
            (command.Subshell
              command_list: 
                (command.CommandList
                  children: [
                    (command.Case
                      to_match: {(DQ ($ VSub_DollarName '$merge') (',') ($ VSub_DollarName '$v'))}
                      arms: [
                        (case_arm
                          pat_list: [{(Lit_Comma ',') (Lit_Other '*')}]
                          action: [(command.ControlFlow token:<ControlFlow_Exit exit> arg_word:{(1)})]
                        )
                        (case_arm pat_list:[{(1) (Lit_Comma ',')}])
                        (case_arm
                          pat_list: [{(Lit_Other '*')}]
                          action: [
                            (command.SimpleCommand
                              words: [{(echo)} {(DQ ('Falling back to 3-way merge...'))}]
                              redirects: [
                                (redir.Redir
                                  op: <Redir_GreatAnd '>&'>
                                  fd: 16777215
                                  arg_word: {(2)}
                                )
                              ]
                            )
                          ]
                        )
                      ]
                    )
                    (command.AndOr
                      ops: [Op_DAmp Op_DAmp Op_DPipe]
                      children: [
                        (command.Pipeline
                          children: [
                            (C {(git)} {(diff-files)} {(--name-only)})
                            (C {(git)} {(update-index)} {(--remove)} {(--stdin)})
                          ]
                          negated: F
                        )
                        (command.Assignment
                          keyword: Assign_None
                          pairs: [
                            (assign_pair
                              lhs: (lhs_expr.LhsName name:work)
                              op: Equal
                              rhs: 
                                {
                                  (word_part.CommandSubPart
                                    command_list: 
                                      (command.CommandList
                                        children: [(C {(git)} {(write-tree)})]
                                      )
                                    left_token: <Left_CommandSub '$('>
                                  )
                                }
                            )
                          ]
                        )
                        (C {(git)} {(read-tree)} {($ VSub_DollarName '$v')} {(--reset)} {(-u)} 
                          {($ VSub_DollarName '$new')}
                        )
                        (command.ControlFlow token:<ControlFlow_Exit exit>)
                      ]
                    )
                    (command.AndOr
                      ops: [Op_DAmp Op_DAmp Op_DAmp]
                      children: [
                        (C {(eval)} 
                          {(GITHEAD_) ($ VSub_DollarName '$new') (Lit_Other '=') 
                            (SQ <'${new_name:-${branch:-$new}}'>)
                          }
                        )
                        (C {(eval)} 
                          {(GITHEAD_) ($ VSub_DollarName '$work') (Lit_Other '=') (Assign_Local local)}
                        )
                        (C {(export)} {(GITHEAD_) ($ VSub_DollarName '$new')} 
                          {(GITHEAD_) ($ VSub_DollarName '$work')}
                        )
                        (C {(git)} {(merge-recursive)} {($ VSub_DollarName '$old')} {(--)} 
                          {($ VSub_DollarName '$new')} {($ VSub_DollarName '$work')}
                        )
                      ]
                    )
                    (command.Assignment
                      keyword: Assign_None
                      pairs: [
                        (assign_pair
                          lhs: (lhs_expr.LhsName name:unmerged)
                          op: Equal
                          rhs: 
                            {
                              (word_part.CommandSubPart
                                command_list: 
                                  (command.CommandList
                                    children: [(C {(git)} {(ls-files)} {(-u)})]
                                  )
                                left_token: <Left_CommandSub '$('>
                              )
                            }
                        )
                      ]
                    )
                    (C {(git)} {(read-tree)} {($ VSub_DollarName '$v')} {(--reset)} 
                      {($ VSub_DollarName '$new')}
                    )
                    (command.Case
                      to_match: {(DQ ($ VSub_DollarName '$unmerged'))}
                      arms: [
                        (case_arm pat_list:[{(SQ )}])
                        (case_arm
                          pat_list: [{(Lit_Other '*')}]
                          action: [
                            (command.Pipeline
                              children: [
                                (command.Subshell
                                  command_list: 
                                    (command.CommandList
                                      children: [
                                        (command.Assignment
                                          keyword: Assign_None
                                          pairs: [
                                            (assign_pair
                                              lhs: (lhs_expr.LhsName name:z40)
                                              op: Equal
                                              rhs: {(0000000000000000000000000000000000000000)}
                                            )
                                          ]
                                        )
                                        (command.Pipeline
                                          children: [
                                            (C {(echo)} {(DQ ($ VSub_DollarName '$unmerged'))})
                                            (C {(sed)} {(-e)} 
                                              {(SQ <'s/^[0-7]* [0-9a-f]* /'>) 
                                                (DQ ('0 ') ($ VSub_DollarName '$z40') (' /'))
                                              }
                                            )
                                          ]
                                          negated: F
                                        )
                                        (C {(echo)} {(DQ ($ VSub_DollarName '$unmerged'))})
                                      ]
                                    )
                                )
                                (C {(git)} {(update-index)} {(--index-info)})
                              ]
                              negated: F
                            )
                          ]
                        )
                      ]
                    )
                    (command.ControlFlow
                      token: <ControlFlow_Exit exit>
                      arg_word: {(0)}
                    )
                  ]
                )
            )
          ]
        )
        (command.Assignment
          keyword: Assign_None
          pairs: [
            (assign_pair
              lhs: (lhs_expr.LhsName name:saved_err)
              op: Equal
              rhs: {($ VSub_QMark '$?')}
            )
          ]
        )
        (command.If
          arms: [
            (if_arm
              cond: [
                (command.AndOr
                  ops: [Op_DAmp]
                  children: [
                    (C {(test)} {(DQ ($ VSub_DollarName '$saved_err'))} {(Lit_Other '=')} {(0)})
                    (C {(test)} {(-z)} {(DQ ($ VSub_DollarName '$quiet'))})
                  ]
                )
              ]
              action: [(C {(git)} {(diff-index)} {(--name-status)} {(DQ ($ VSub_DollarName '$new'))})]
            )
          ]
        )
        (command.Subshell
          command_list: 
            (command.CommandList
              children: [
                (command.ControlFlow
                  token: <ControlFlow_Exit exit>
                  arg_word: {($ VSub_DollarName '$saved_err')}
                )
              ]
            )
        )
      ]
    )
    (command.If
      arms: [
        (if_arm
          cond: [
            (command.Sentence
              child: (C {(Lit_Other '[')} {(DQ ($ VSub_QMark '$?'))} {(-eq)} {(0)} {(Lit_Other ']')})
              terminator: <Op_Semi ';'>
            )
          ]
          action: [
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (C {(Lit_Other '[')} {(DQ ($ VSub_DollarName '$newbranch'))} {(Lit_Other ']')})
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [
                    (command.AndOr
                      ops: [Op_DPipe]
                      children: [
                        (C {(git)} {(branch)} {($ VSub_DollarName '$track')} 
                          {($ VSub_DollarName '$newbranch_log')} {(DQ ($ VSub_DollarName '$newbranch'))} {(DQ ($ VSub_DollarName '$new_name'))}
                        )
                        (command.ControlFlow token:<ControlFlow_Exit exit>)
                      ]
                    )
                    (command.Assignment
                      keyword: Assign_None
                      pairs: [
                        (assign_pair
                          lhs: (lhs_expr.LhsName name:branch)
                          op: Equal
                          rhs: {(DQ ($ VSub_DollarName '$newbranch'))}
                        )
                      ]
                    )
                  ]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: [(C {(test)} {(-n)} {(DQ ($ VSub_DollarName '$branch'))})]
                  action: [
                    (command.Assignment
                      keyword: Assign_None
                      pairs: [
                        (assign_pair
                          lhs: (lhs_expr.LhsName name:old_branch_name)
                          op: Equal
                          rhs: 
                            {
                              (word_part.CommandSubPart
                                command_list: 
                                  (command.CommandList
                                    children: [
                                      (C {(expr)} {(DQ (z) ($ VSub_DollarName '$oldbranch'))} 
                                        {(Lit_Other ':')} {(SQ <'zrefs/heads/\\(.*\\)'>)}
                                      )
                                    ]
                                  )
                                left_token: <Left_CommandSub '$('>
                              )
                            }
                        )
                      ]
                    )
                    (command.SimpleCommand
                      words: [
                        {(git)}
                        {(symbolic-ref)}
                        {(-m)}
                        {
                          (DQ ('checkout: moving from ') 
                            (word_part.BracedVarSub
                              token: <VSub_Name old_branch_name>
                              suffix_op: 
                                (suffix_op.StringUnary
                                  op_id: VTest_ColonHyphen
                                  arg_word: {($ VSub_DollarName '$old')}
                                )
                            ) (' to ') ($ VSub_DollarName '$branch')
                          )
                        }
                        {(HEAD)}
                        {(DQ (refs/heads/) ($ VSub_DollarName '$branch'))}
                      ]
                      more_env: [(env_pair name:GIT_DIR val:{(DQ ($ VSub_DollarName '$GIT_DIR'))})]
                    )
                    (command.If
                      arms: [
                        (if_arm
                          cond: [(C {(test)} {(-n)} {(DQ ($ VSub_DollarName '$quiet'))})]
                          action: [(C {(true)})]
                        )
                        (if_arm
                          cond: [
                            (C {(test)} {(DQ (refs/heads/) ($ VSub_DollarName '$branch'))} 
                              {(Lit_Other '=')} {(DQ ($ VSub_DollarName '$oldbranch'))}
                            )
                          ]
                          action: [
                            (command.SimpleCommand
                              words: [
                                {(echo)}
                                {
                                  (DQ ('Already on branch ') 
                                    (word_part.EscapedLiteralPart
                                      token: <Lit_EscapedChar '\\"'>
                                    ) ($ VSub_DollarName '$branch') (word_part.EscapedLiteralPart token:<Lit_EscapedChar '\\"'>)
                                  )
                                }
                              ]
                              redirects: [
                                (redir.Redir
                                  op: <Redir_GreatAnd '>&'>
                                  fd: 16777215
                                  arg_word: {(2)}
                                )
                              ]
                            )
                          ]
                        )
                      ]
                      else_action: [
                        (command.SimpleCommand
                          words: [
                            {(echo)}
                            {
                              (DQ ('Switched to') 
                                (word_part.BracedVarSub
                                  token: <VSub_Name newbranch>
                                  suffix_op: 
                                    (suffix_op.StringUnary
                                      op_id: VTest_ColonPlus
                                      arg_word: {(' a new')}
                                    )
                                ) (' branch ') (word_part.EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) ($ VSub_DollarName '$branch') 
                                (word_part.EscapedLiteralPart
                                  token: <Lit_EscapedChar '\\"'>
                                )
                              )
                            }
                          ]
                          redirects: [(redir.Redir op:<Redir_GreatAnd '>&'> fd:16777215 arg_word:{(2)})]
                        )
                      ]
                    )
                  ]
                )
                (if_arm
                  cond: [(C {(test)} {(-n)} {(DQ ($ VSub_DollarName '$detached'))})]
                  action: [
                    (command.Assignment
                      keyword: Assign_None
                      pairs: [
                        (assign_pair
                          lhs: (lhs_expr.LhsName name:old_branch_name)
                          op: Equal
                          rhs: 
                            {
                              (word_part.CommandSubPart
                                command_list: 
                                  (command.CommandList
                                    children: [
                                      (C {(expr)} {(DQ (z) ($ VSub_DollarName '$oldbranch'))} 
                                        {(Lit_Other ':')} {(SQ <'zrefs/heads/\\(.*\\)'>)}
                                      )
                                    ]
                                  )
                                left_token: <Left_CommandSub '$('>
                              )
                            }
                        )
                      ]
                    )
                    (command.AndOr
                      ops: [Op_DPipe]
                      children: [
                        (C {(git)} {(update-ref)} {(--no-deref)} {(-m)} 
                          {
                            (DQ ('checkout: moving from ') 
                              (word_part.BracedVarSub
                                token: <VSub_Name old_branch_name>
                                suffix_op: 
                                  (suffix_op.StringUnary
                                    op_id: VTest_ColonHyphen
                                    arg_word: {($ VSub_DollarName '$old')}
                                  )
                              ) (' to ') ($ VSub_DollarName '$arg')
                            )
                          } {(HEAD)} {(DQ ($ VSub_DollarName '$detached'))}
                        )
                        (C {(die)} {(DQ ('Cannot detach HEAD'))})
                      ]
                    )
                    (command.If
                      arms: [
                        (if_arm
                          cond: [(C {(test)} {(-n)} {(DQ ($ VSub_DollarName '$detach_warn'))})]
                          action: [
                            (command.SimpleCommand
                              words: [{(echo)} {(DQ ($ VSub_DollarName '$detach_warn'))}]
                              redirects: [
                                (redir.Redir
                                  op: <Redir_GreatAnd '>&'>
                                  fd: 16777215
                                  arg_word: {(2)}
                                )
                              ]
                            )
                          ]
                        )
                      ]
                    )
                    (C {(describe_detached_head)} {(SQ <'HEAD is now at'>)} {(HEAD)})
                  ]
                )
              ]
            )
            (C {(rm)} {(-f)} {(DQ ($ VSub_DollarName '$GIT_DIR') (/MERGE_HEAD))})
          ]
        )
      ]
      else_action: [(command.ControlFlow token:<ControlFlow_Exit exit> arg_word:{(1)})]
    )
    (command.If
      arms: [
        (if_arm
          cond: [
            (command.Sentence
              child: (C {(test)} {(-x)} {(DQ ($ VSub_DollarName '$GIT_DIR')) (/hooks/post-checkout)})
              terminator: <Op_Semi ';'>
            )
          ]
          action: [
            (C {(DQ ($ VSub_DollarName '$GIT_DIR')) (/hooks/post-checkout)} 
              {($ VSub_DollarName '$old')} {($ VSub_DollarName '$new')} {(1)}
            )
          ]
        )
      ]
    )
  ]
)