         notifier.addSuccess "Added #{file ? 'all files'}"
         true
 
-  # Public: Get the repository of the current file or project if no current file
-  # Returns a {Promise} that resolves to a repository like object
   getRepo: ->
     new Promise (resolve, reject) ->
       getRepoForCurrentFile().then (repo) -> resolve(repo)

    else
      reject "no current file"

module.exports = git = {
  # Public: Execute a git command.
  #
  # args    - An {Array} containing the arguments for the command.
  # options - An {Object} with the following keys:
  #   :cwd  - Current working directory as {String}.
  #   :options - The {Object} with options used by child_process
  #
  # Returns a {Promise}.
  cmd: (args, {cwd, options}={}) ->
    new Promise (resolve, reject) ->
      options ?= {}
      options.cwd ?= cwd
      output = ''
      try
        new BufferedProcess

        repo.refreshStatus()
        git.cmd ['add', '--refresh', '--', '.'], cwd: repo.getWorkingDirectory()

  relativize: (path) ->
    git.getSubmodule(path)?.relativize(path) ? atom.project.getRepositories()[0]?.relativize(path) ? path

