(command.CommandList
  children: [
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'repository='> name:repository)
          op: assign_op.Equal
          rhs: 
            {
              (braced_var_sub
                left: <Id.Left_DollarBrace '${'>
                token: <Id.VSub_Number 1>
                var_name: 1
                suffix_op: (suffix_op.Unary op:<Id.VTest_QMark _> arg_word:{<repository>})
                right: <Id.Right_DollarBrace '}'>
              )
            }
          spids: [7]
        )
      ]
      redirects: []
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'destdir='> name:destdir)
          op: assign_op.Equal
          rhs: 
            {
              (braced_var_sub
                left: <Id.Left_DollarBrace '${'>
                token: <Id.VSub_Number 2>
                var_name: 2
                suffix_op: (suffix_op.Unary op:<Id.VTest_QMark _> arg_word:{<destination>})
                right: <Id.Right_DollarBrace '}'>
              )
            }
          spids: [14]
        )
      ]
      redirects: []
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'head='> name:head)
          op: assign_op.Equal
          rhs: {<master>}
          spids: [22]
        )
        (assign_pair
          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'GIT_DIR='> name:GIT_DIR)
          op: assign_op.Equal
          rhs: (rhs_word.Empty)
          spids: [25]
        )
      ]
      redirects: []
    )
    (command.ForEach
      iter_names: [d]
      iterable: 
        (for_iter.Words
          words: [
            {(DQ ($ Id.VSub_DollarName repository) <'/.git'>)}
            {(DQ ($ Id.VSub_DollarName repository))}
          ]
        )
      body: 
        (command.DoGroup
          children: [
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (command.Simple
                          words: [{<git>} {<rev-parse>} {<'refs/heads/master'>}]
                          redirects: [
                            (redir
                              op: <Id.Redir_Great '>'>
                              loc: (redir_loc.Fd fd:1)
                              arg: {<'/dev/null'>}
                            )
                            (redir
                              op: <Id.Redir_GreatAnd '2>&'>
                              loc: (redir_loc.Fd fd:2)
                              arg: {<1>}
                            )
                          ]
                          more_env: [
                            (env_pair
                              name: GIT_DIR
                              val: {(DQ ($ Id.VSub_DollarName d))}
                              spids: [47]
                            )
                          ]
                          do_fork: T
                        )
                      ]
                    )
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'GIT_DIR='> name:GIT_DIR)
                          op: assign_op.Equal
                          rhs: {(DQ ($ Id.VSub_DollarName d))}
                          spids: [68]
                        )
                      ]
                      redirects: []
                    )
                    (C {<export>} {<GIT_DIR>})
                    (command.ControlFlow token:<Id.ControlFlow_Break break>)
                  ]
                  spids: [45 65]
                )
              ]
              else_action: []
              redirects: []
            )
          ]
        )
      redirects: []
    )
    (command.If
      arms: [
        (if_arm
          cond: 
            (condition.Shell
              commands: [(C {<test>} {<-z>} {(DQ ($ Id.VSub_DollarName GIT_DIR))})]
            )
          action: [
            (command.Simple
              words: [
                {<echo>}
                {
                  (DQ <'Neither '> ($ Id.VSub_DollarName repository) <' nor '> 
                    ($ Id.VSub_DollarName repository) <'/.git is a repository'>
                  )
                }
              ]
              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: [87 97]
        )
      ]
      else_action: []
      redirects: []
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'GIT_WORK_TREE='> name:GIT_WORK_TREE)
          op: assign_op.Equal
          rhs: 
            {
              (command_sub
                left_token: <Id.Left_DollarParen '$('>
                child: (C {<pwd>})
                right: <Id.Eof_RParen _>
              )
            }
          spids: [121]
        )
      ]
      redirects: []
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'GIT_INDEX_FILE='> name:GIT_INDEX_FILE)
          op: assign_op.Equal
          rhs: 
            {
              (command_sub
                left_token: <Id.Left_DollarParen '$('>
                child: (C {<pwd>})
                right: <Id.Eof_RParen _>
              ) <'/.quick-doc.'> ($ Id.VSub_Dollar '$')
            }
          spids: [126]
        )
      ]
      redirects: []
    )
    (C {<export>} {<GIT_INDEX_FILE>} {<GIT_WORK_TREE>})
    (C {<rm>} {<-f>} {(DQ ($ Id.VSub_DollarName GIT_INDEX_FILE))})
    (C {<trap>} {(SQ <'rm -f "$GIT_INDEX_FILE"'>)} {<0>})
    (C {<git>} {<read-tree>} {($ Id.VSub_DollarName head)})
    (C {<git>} {<checkout-index>} {<-a>} {<-f>} 
      {<--prefix> <Id.Lit_Equals '='> (DQ ($ Id.VSub_DollarName destdir)) <'/'>}
    )
    (command.If
      arms: [
        (if_arm
          cond: (condition.Shell commands:[(C {<test>} {<-n>} {(DQ ($ Id.VSub_DollarName GZ))})])
          action: [
            (command.Pipeline
              children: [
                (C {<git>} {<ls-tree>} {<-r>} {<--name-only>} {($ Id.VSub_DollarName head)})
                (C {<xargs>} {<printf>} 
                  {(DQ ($ Id.VSub_DollarName destdir) <'/%s'> <Id.Lit_BadBackslash '\\'> <n>)}
                )
                (C {<xargs>} {<gzip>} {<-f>})
              ]
              negated: F
              stderr_indices: []
            )
          ]
          spids: [178 188]
        )
      ]
      else_action: []
      redirects: []
    )
    (C {<rm>} {<-f>} {(DQ ($ Id.VSub_DollarName GIT_INDEX_FILE))})
  ]
)