Added .getReferenceTarget

This commit is contained in:
joshaber
2015-12-03 11:54:55 -05:00
parent c1e511927b
commit 70601772d0
2 changed files with 20 additions and 2 deletions

View File

@@ -288,13 +288,18 @@ export default class GitRepositoryAsync {
})
}
// Public: Returns the current {String} SHA for the given reference.
// Public: Get the SHA for the given reference.
//
// * `reference` The {String} reference to get the target of.
// * `path` An optional {String} path in the repo to get the reference target
// for. Only needed if the repository contains submodules.
//
// Returns a {Promise} which resolves to the current {String} SHA for the
// given reference.
getReferenceTarget (reference, _path) {
throw new Error('Unimplemented')
return this._getRepo(_path)
.then(repo => repo.getReference(reference))
.then(ref => ref.target().tostrS())
}
// Reading Status