Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions lib/repository.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
});
}
Expand Down Expand Up @@ -1255,8 +1253,8 @@ Repository.prototype.getReferenceCommit = function(name, callback) {
* @param {Reference.TYPE} type Type of reference to look up
* @return {Array<String>}
*/
Repository.prototype.getReferenceNames = function(type, callback) {
return Repository.getReferences(this, type, true, callback);
Repository.prototype.getReferenceNames = function(type) {
return Repository.getReferences(this, type, true);
};

/**
Expand Down