         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)

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

  # returns filepath relativized for either a submodule or repository
  #   otherwise just a full path
  relativize: (path) ->
    git.getSubmodule(path)?.relativize(path) ? atom.project.getRepositories()[0]?.relativize(path) ? path


        else
          resolve(repos[0])

  getSubmodule: (path) ->
    path ?= atom.workspace.getActiveTextEditor()?.getPath()
    atom.project.getRepositories().filter((r) ->
      r?.repo.submoduleForPath path
    )[0]?.repo?.submoduleForPath path

  dir: (andSubmodules=true) ->
    new Promise (resolve, reject) =>
      if andSubmodules and submodule = git.getSubmodule()
        resolve(submodule.getWorkingDirectory())
      else
        git.getRepo().then (repo) -> resolve(repo.getWorkingDirectory())
