mirror of
https://github.com/bower/bower.git
synced 2026-02-11 22:44:58 -05:00
Fix bug when targeting branches.
This commit is contained in:
@@ -53,7 +53,6 @@ GitResolver.fetchRefs = function (source) {};
|
||||
|
||||
GitResolver.prototype._findResolution = function () {
|
||||
var branches,
|
||||
target,
|
||||
self = this.constructor;
|
||||
|
||||
// Target is a range/version
|
||||
@@ -86,16 +85,16 @@ GitResolver.prototype._findResolution = function () {
|
||||
// Otherwise, assume target is a branch
|
||||
return self.fetchHeads(this._sourcePath)
|
||||
.then(function (heads) {
|
||||
if (!heads[target]) {
|
||||
if (!heads[this._target]) {
|
||||
branches = Object.keys(heads);
|
||||
throw createError('Branch "' + target + '" does not exist', 'ENORESTARGET', {
|
||||
throw createError('Branch "' + this._target + '" does not exist', 'ENORESTARGET', {
|
||||
details: !branches.length ?
|
||||
'No branches found in "' + this._source + '"' :
|
||||
'Available branches in "' + this._source + '" are: ' + branches.join(', ')
|
||||
});
|
||||
}
|
||||
|
||||
return { type: 'branch', branch: target, commit: heads[target] };
|
||||
return { type: 'branch', branch: this._target, commit: heads[this._target] };
|
||||
}.bind(this));
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user