(command.CommandList
  children: [
    (command.Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (lhs_expr.LhsName name:GRAFTS_FILE spids:[11])
          op: Equal
          rhs: 
            {
              (DQ 
                (word_part.BracedVarSub
                  token: <VSub_Name GIT_DIR>
                  suffix_op: (suffix_op.StringUnary op_id:VTest_ColonHyphen arg_word:{(.git)})
                  spids: [13 17]
                ) (/info/grafts)
              )
            }
          spids: [11]
        )
      ]
      spids: [11]
    )
    (C {(.)} 
      {
        (word_part.CommandSubPart
          command_list: (command.CommandList children:[(C {(git)} {(--exec-path)})])
          left_token: <Left_CommandSub '$('>
          spids: [24 28]
        ) (/git-sh-setup)
      }
    )
    (command.AndOr
      ops: [Op_DPipe]
      children: [
        (C {(test)} {(-f)} {(DQ ($ VSub_DollarName '$GRAFTS_FILE'))})
        (C {(die)} {(DQ ("Could not find graft file: '") ($ VSub_DollarName '$GRAFTS_FILE') ("'"))})
      ]
    )
    (command.Pipeline
      children: [
        (C {(grep)} {(SQ <'^[^# ]'>)} {(DQ ($ VSub_DollarName '$GRAFTS_FILE'))})
        (command.WhileUntil
          keyword: <KW_While while>
          cond: [(C {(read)} {(definition)})]
          body: 
            (command.DoGroup
              children: [
                (command.If
                  arms: [
                    (if_arm
                      cond: [(C {(test)} {(-n)} {(DQ ($ VSub_DollarName '$definition'))})]
                      action: [
                        (C {(echo)} {(DQ ('Converting: ') ($ VSub_DollarName '$definition'))})
                        (command.AndOr
                          ops: [Op_DPipe]
                          children: [
                            (C {(git)} {(replace)} {(--graft)} {($ VSub_DollarName '$definition')})
                            (C {(die)} 
                              {(DQ ('Conversion failed for: ') ($ VSub_DollarName '$definition'))}
                            )
                          ]
                        )
                      ]
                      spids: [16777215 83]
                    )
                  ]
                  spids: [16777215 113]
                )
              ]
              spids: [69 115]
            )
        )
      ]
      negated: F
    )
    (command.AndOr
      ops: [Op_DPipe]
      children: [
        (C {(mv)} {(DQ ($ VSub_DollarName '$GRAFTS_FILE'))} 
          {(DQ ($ VSub_DollarName '$GRAFTS_FILE') (.bak))}
        )
        (C {(die)} 
          {
            (DQ ("Could not rename '") ($ VSub_DollarName '$GRAFTS_FILE') ("' to '") 
              ($ VSub_DollarName '$GRAFTS_FILE') (".bak'")
            )
          }
        )
      ]
    )
    (C {(echo)} {(DQ ('Success!'))})
    (C {(echo)} 
      {
        (DQ ("All the grafts in '") ($ VSub_DollarName '$GRAFTS_FILE') 
          ("' have been converted to replace refs!")
        )
      }
    )
    (C {(echo)} 
      {
        (DQ ("The grafts file '") ($ VSub_DollarName '$GRAFTS_FILE') ("' has been renamed: '") 
          ($ VSub_DollarName '$GRAFTS_FILE') (".bak'")
        )
      }
    )
  ]
)