mirror of
https://github.com/atom/atom.git
synced 2026-01-24 06:18:03 -05:00
18 lines
431 B
CoffeeScript
18 lines
431 B
CoffeeScript
Git = require 'git-utils'
|
|
path = require 'path'
|
|
|
|
module.exports = (repoPath) ->
|
|
repo = Git.open(repoPath)
|
|
if repo?
|
|
workingDirectoryPath = repo.getWorkingDirectory()
|
|
statuses = {}
|
|
for filePath, status of repo.getStatus()
|
|
statuses[path.join(workingDirectoryPath, filePath)] = status
|
|
upstream = repo.getAheadBehindCount()
|
|
repo.release()
|
|
else
|
|
upstream = {}
|
|
statuses = {}
|
|
|
|
{statuses, upstream}
|