       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
      atom.project.getRepo()?.getWorkingDirectory() ? atom.project.getPath()

  filePath: -> path.join @dir(), @file()
  currentPane: atom.workspace.getActivePane()

  constructor: (@amend='') ->

        @subscribe buffer, 'destroyed', =>
          if @isAmending then @undoAmend() else @cleanup()

  # Public: When the user is done editing the commit message an saves the file
  #         this method gets invoked and commits the changes.
  commit: ->
    args = ['commit', '--cleanup=strip', "--file=#{@filePath()}"]
    git.cmd
