(command.CommandList
  children: [
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:repository)
          op: Equal
          rhs: 
            {
              (braced_var_sub
                token: <VSub_Number 1>
                suffix_op: (suffix_op.Unary op_id:VTest_QMark arg_word:{(repository)})
              )
            }
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:destdir)
          op: Equal
          rhs: 
            {
              (braced_var_sub
                token: <VSub_Number 2>
                suffix_op: (suffix_op.Unary op_id:VTest_QMark arg_word:{(destination)})
              )
            }
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair lhs:(sh_lhs_expr.Name name:head) op:Equal rhs:{(master)})
        (assign_pair lhs:(sh_lhs_expr.Name name:GIT_DIR) op:Equal rhs:(word.Empty))
      ]
    )
    (command.ForEach
      iter_name: d
      iter_words: [
        {(DQ ($ VSub_DollarName '$repository') (/.git))}
        {(DQ ($ VSub_DollarName '$repository'))}
      ]
      do_arg_iter: F
      body: 
        (command.DoGroup
          children: [
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Simple
                      words: [{(git)} {(rev-parse)} {(refs/heads/master)}]
                      redirects: [
                        (redir.Redir
                          op: <Redir_Great '>'>
                          fd: 16777215
                          arg_word: {(/dev/null)}
                        )
                        (redir.Redir
                          op: <Redir_GreatAnd '2>&'>
                          fd: 2
                          arg_word: {(1)}
                        )
                      ]
                      more_env: [(env_pair name:GIT_DIR val:{(DQ ($ VSub_DollarName '$d'))})]
                    )
                  ]
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:GIT_DIR)
                          op: Equal
                          rhs: {(DQ ($ VSub_DollarName '$d'))}
                        )
                      ]
                    )
                    (C {(export)} {(GIT_DIR)})
                    (command.ControlFlow token:<ControlFlow_Break break>)
                  ]
                )
              ]
            )
          ]
        )
    )
    (command.If
      arms: [
        (if_arm
          cond: [(C {(test)} {(-z)} {(DQ ($ VSub_DollarName '$GIT_DIR'))})]
          action: [
            (command.Simple
              words: [
                {(echo)}
                {
                  (DQ ('Neither ') ($ VSub_DollarName '$repository') (' nor ') 
                    ($ VSub_DollarName '$repository') ('/.git is a repository')
                  )
                }
              ]
              redirects: [(redir.Redir op:<Redir_GreatAnd '>&'> fd:16777215 arg_word:{(2)})]
            )
            (command.ControlFlow token:<ControlFlow_Exit exit> arg_word:{(1)})
          ]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:GIT_WORK_TREE)
          op: Equal
          rhs: 
            {
              (command_sub
                left_token: <Left_DollarParen '$('>
                command_list: (command.CommandList children:[(C {(pwd)})])
              )
            }
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:GIT_INDEX_FILE)
          op: Equal
          rhs: 
            {
              (command_sub
                left_token: <Left_DollarParen '$('>
                command_list: (command.CommandList children:[(C {(pwd)})])
              ) (/.quick-doc.) ($ VSub_Dollar '$$')
            }
        )
      ]
    )
    (C {(export)} {(GIT_INDEX_FILE)} {(GIT_WORK_TREE)})
    (C {(rm)} {(-f)} {(DQ ($ VSub_DollarName '$GIT_INDEX_FILE'))})
    (C {(trap)} {(SQ <'rm -f "$GIT_INDEX_FILE"'>)} {(0)})
    (C {(git)} {(read-tree)} {($ VSub_DollarName '$head')})
    (C {(git)} {(checkout-index)} {(-a)} {(-f)} 
      {(--prefix) (Lit_Equals '=') (DQ ($ VSub_DollarName '$destdir')) (/)}
    )
    (command.If
      arms: [
        (if_arm
          cond: [(C {(test)} {(-n)} {(DQ ($ VSub_DollarName '$GZ'))})]
          action: [
            (command.Pipeline
              children: [
                (C {(git)} {(ls-tree)} {(-r)} {(--name-only)} {($ VSub_DollarName '$head')})
                (C {(xargs)} {(printf)} 
                  {(DQ ($ VSub_DollarName '$destdir') ('/%s') (Lit_Other '\\') (n))}
                )
                (C {(xargs)} {(gzip)} {(-f)})
              ]
              negated: F
            )
          ]
        )
      ]
    )
    (C {(rm)} {(-f)} {(DQ ($ VSub_DollarName '$GIT_INDEX_FILE'))})
  ]
)