mirror of
https://github.com/atom/atom.git
synced 2026-04-06 03:02:13 -04:00
20 lines
485 B
CoffeeScript
20 lines
485 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()
|
|
branch = repo.getHead()
|
|
repo.release()
|
|
else
|
|
upstream = {}
|
|
statuses = {}
|
|
branch = null
|
|
|
|
{statuses, upstream, branch}
|