         (done) ->
           # Ensure no changes
           abort = false
-          exec('git', ['status', '--porcelain'], { stdio: [process.stdin, 'pipe', process.stderr] }, (err) ->
+          child = exec('git', ['status', '--porcelain'], { stdio: [process.stdin, 'pipe', process.stderr] }, (err) ->
             if not err? and abort
               err = new Error('Changes detected. Please ensure the staging area is clean before running')
             if err?

    options.output = util.mergeOptions(config.output, options.output)

    exec = (cmd, args, options, cbDone, cbError) ->
      if typeof options != object
        cbError = cbDone
        cbDone = options
        options = {}

        (done) ->
          # Ensure we are committing the master
          name = ''
          child = exec('git', ['rev-parse', '--abbrev-ref', 'HEAD'], { stdio: [process.stdin, 'pipe', process.stderr] }, (err) ->
            if not err? and name != 'master'
              err = new Error('Current branch is not master. Please only distribute from master.')
            if err?
