     notifier.addError data
     destroyCommitEditor(filePath)
 
-cleanup = (currentPane, filePath) ->
+cleanup = (currentPane) ->
   currentPane.activate() if currentPane.isAlive()
   disposables.dispose()
 

    ''

prepFile = ({status, filePath, diff, commentChar, template}) ->
  cwd = Path.dirname(filePath)
  status = status.replace(/\s*\(.*\)\n/g, "\n")
  status = status.trim().replace(/\n/g, "\n#{commentChar} ")

  startCommit = ->
    showFile filePath
    .then (textEditor) ->
      disposables.dispose()
      disposables = new CompositeDisposable
      disposables.add textEditor.onDidSave ->
        trimFile(filePath, commentChar) if verboseCommitsEnabled()
        commit(repo.getWorkingDirectory(), filePath)
        .then -> GitPush(repo) if andPush
      disposables.add textEditor.onDidDestroy -> cleanup(currentPane)
    .catch(notifier.addError)

  if stageChanges
