diff --git a/lib/repository.js b/lib/repository.js index 29c429fad..aa7c406e4 100644 --- a/lib/repository.js +++ b/lib/repository.js @@ -351,14 +351,12 @@ Repository.initExt = function(repo_path, opts) { Repository.getReferences = function(repo, type, refNamesOnly) { return repo.getReferences().then(function(refList) { - var filteredRefList = refList; - - filteredRefList.filter(function(reference) { - return type == Reference.TYPE.LISTALL || reference.type === type; + var filteredRefList = refList.filter(function(reference) { + return type === Reference.TYPE.ALL || reference.type === type; }); if (refNamesOnly) { - filteredRefList.map(function(reference) { + return filteredRefList.map(function(reference) { return reference.name(); }); } @@ -1255,8 +1253,8 @@ Repository.prototype.getReferenceCommit = function(name, callback) { * @param {Reference.TYPE} type Type of reference to look up * @return {Array} */ -Repository.prototype.getReferenceNames = function(type, callback) { - return Repository.getReferences(this, type, true, callback); +Repository.prototype.getReferenceNames = function(type) { + return Repository.getReferences(this, type, true); }; /**