Trim refs to prevent empty lines to be in the array.

This commit is contained in:
André Cruz
2013-04-23 23:18:07 +01:00
parent 823a845752
commit 627c75b6b9
2 changed files with 2 additions and 2 deletions

View File

@@ -71,7 +71,7 @@ GitFsResolver.fetchRefs = function (source) {
return cmd('git', ['show-ref', '--tags', '--heads'], { cwd : source })
.then(function (stdout) {
// Make them an array
var refs = stdout.toString().split('\n');
var refs = stdout.toString().trim().split('\n');
this._refs = this._refs || {};
return this._refs[source] = refs;

View File

@@ -42,7 +42,7 @@ GitRemoteResolver.fetchRefs = function (source) {
return cmd('git', ['ls-remote', '--tags', '--heads', source])
.then(function (stdout) {
// Make them an array
var refs = stdout.toString().split('\n');
var refs = stdout.toString().trim().split('\n');
this._refs = this._refs || {};
return this._refs[source] = refs;