Merge pull request #6077 from atom/bf-repository-type

Add `Repository::getType()`.
This commit is contained in:
Kevin Sawicki
2015-03-23 16:31:45 -07:00
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())