         @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

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

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

  constructor: (@amend='') ->

        @cleanup()
        new StatusView(type: 'error', message: 'Nothing to commit.')

  # Public: Prepares our commit message file by writing the status and a
  #         possible amend message to it.
  #
  # status - The current status as {String}.
  prepFile: (status) ->
    # format the status to be ignored in the commit message
    status = status.replace(/\s*\(.*\)\n/g, '')
