Add Repository::getType().

For `GitRepository`, this will return `"git"`.
This commit is contained in:
Michael Bolin 2015-03-23 15:38:38 -07:00
parent 19975cedbb
commit 14316b1cd7
2 changed files with 7 additions and 0 deletions

View File

@ -16,6 +16,7 @@ describe "GitRepositoryProvider", ->
expect(result).toBeInstanceOf GitRepository
expect(provider.pathToRepository[result.getPath()]).toBeTruthy()
expect(result.statusTask).toBeTruthy()
expect(result.getType()).toBe 'git'
it "returns the same GitRepository for different Directory objects in the same repo", ->
provider = new GitRepositoryProvider atom.project

View File

@ -169,6 +169,12 @@ class GitRepository
Section: Repository Details
###
# Public: A {String} indicating the type of version control system used by
# this repository.
#
# Returns `"git"`.
getType: -> 'git'
# Public: Returns the {String} path of the repository.
getPath: ->
@path ?= fs.absolute(@getRepo().getPath())