Added .getConfigValue

This commit is contained in:
joshaber
2015-12-03 12:18:00 -05:00
parent 70601772d0
commit 74a0528bef
2 changed files with 27 additions and 5 deletions

View File

@@ -233,8 +233,14 @@ export default class GitRepositoryAsync {
//
// * `path` An optional {String} path in the repository to get this information
// for, only needed if the repository has submodules.
//
// Returns a {Promise} which resolves to the {String} git configuration value
// specified by the key.
getConfigValue (key, _path) {
throw new Error('Unimplemented')
return this._getRepo(_path)
.then(repo => repo.configSnapshot())
.then(config => config.getStringBuf(key))
.catch(_ => null)
}
// Public: Returns the origin url of the repository.