   # returns filepath relativized for either a submodule or repository
   #   otherwise just a full path
   relativize: (path) ->
-    @getSubmodule(path)?.relativize(path) ? atom.project.getRepositories()[0]?.relativize(path) ? path
+    git.getSubmodule(path)?.relativize(path) ? atom.project.getRepositories()[0]?.relativize(path) ? path
 
   # Returns the working directory for a git repo.
   # Will search for submodule first if currently

  # @param andSubmodules boolean determining whether to account for submodules
  dir: (andSubmodules=true) ->
    new Promise (resolve, reject) =>
      if andSubmodules and submodule = @getSubmodule()
        resolve(submodule.getWorkingDirectory())
      else
        @getRepo().then (repo) -> resolve(repo.getWorkingDirectory())

  reset: (repo) ->
    @cmd(['reset', 'HEAD'], cwd: repo.getWorkingDirectory()).then () -> notifier.addSuccess 'All changes unstaged'

}


  stagedFiles: (repo, stdout) ->
    # args = ['diff-index', '--cached', 'HEAD', '--name-status', '-z']
    args = ['diff-index', '--cached', 'HEAD', '--name-status']
    git.cmd(args, cwd: repo.getWorkingDirectory())
    .then (data) ->
      _prettify data
    .catch (error) ->
