       stderr: (err) =>
         if @isAmending then @undoAmend() else @cleanup()
 
+  # Public: Destroys the active EditorView to trigger our cleanup method.
   destroyActiveEditorView: ->
     if atom.workspace.getActivePane().getItems().length > 1
       atom.workspace.destroyActivePaneItem()
     else
       atom.workspace.destroyActivePane()
 
+  # Public: Undo the amend
+  #
+  # err - The error message as {String}.
   undoAmend: (err='') ->
     git.cmd
       args: ['reset', 'ORIG_HEAD'],

    else
      '.git/COMMIT_EDITMSG'

  dir: ->
    # path is different for submodules
    if @submodule ?= git.getSubmodule()

    else
      atom.project.getRepo()?.getWorkingDirectory() ? atom.project.getPath()

  # Public: Helper method to join @dir() and @file() to use it with fs.
  #
  # Returns: The full path to our COMMIT_EDITMSG file as {String}
  filePath: -> path.join @dir(), @file()

  currentPane: atom.workspace.getActivePane()

  constructor: (@amend='') ->
