Skip to content

Commit de3d611

Browse files
authored
Merge pull request nodegit#1708 from tiggerite/master
Fix behaviour of Repository#getReferences
2 parents 3a8881d + 58ab918 commit de3d611

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

lib/repository.js

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -351,14 +351,12 @@ Repository.initExt = function(repo_path, opts) {
351351

352352
Repository.getReferences = function(repo, type, refNamesOnly) {
353353
return repo.getReferences().then(function(refList) {
354-
var filteredRefList = refList;
355-
356-
filteredRefList.filter(function(reference) {
357-
return type == Reference.TYPE.LISTALL || reference.type === type;
354+
var filteredRefList = refList.filter(function(reference) {
355+
return type === Reference.TYPE.ALL || reference.type === type;
358356
});
359357

360358
if (refNamesOnly) {
361-
filteredRefList.map(function(reference) {
359+
return filteredRefList.map(function(reference) {
362360
return reference.name();
363361
});
364362
}
@@ -1255,8 +1253,8 @@ Repository.prototype.getReferenceCommit = function(name, callback) {
12551253
* @param {Reference.TYPE} type Type of reference to look up
12561254
* @return {Array<String>}
12571255
*/
1258-
Repository.prototype.getReferenceNames = function(type, callback) {
1259-
return Repository.getReferences(this, type, true, callback);
1256+
Repository.prototype.getReferenceNames = function(type) {
1257+
return Repository.getReferences(this, type, true);
12601258
};
12611259

12621260
/**

0 commit comments

Comments
 (0)