Thanks to visit codestin.com
Credit goes to github.com

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
17 changes: 8 additions & 9 deletions github.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

(function() {
'use strict';

// Initial Setup
// -------------

Expand All @@ -23,10 +23,10 @@
if (typeof btoa === 'undefined') {
btoa = require('btoa'); //jshint ignore:line
}
} else {
} else {
btoa = window.btoa;
}

//prefer native XMLHttpRequest always
/* istanbul ignore if */
if (typeof window !== 'undefined' && typeof window.XMLHttpRequest !== 'undefined'){
Expand Down Expand Up @@ -106,7 +106,7 @@

var links = (xhr.getResponseHeader('link') || '').split(/\s*,\s*/g),
next = null;
links.forEach(function(link) {
links.forEach(function(link) {
next = /rel="next"/.test(link) ? link : next;
});

Expand Down Expand Up @@ -259,7 +259,7 @@
if (branch === currentTree.branch && currentTree.sha) {
return cb(null, currentTree.sha);
}

that.getRef('heads/' + branch, function(err, sha) {
currentTree.branch = branch;
currentTree.sha = sha;
Expand All @@ -275,7 +275,7 @@
if (err) {
return cb(err);
}

cb(null, res.object.sha);
});
};
Expand Down Expand Up @@ -324,7 +324,7 @@
if (err) {
return cb(err);
}

cb(null, tags);
});
};
Expand Down Expand Up @@ -366,8 +366,7 @@
_request("GET", repoPath + "/git/refs/heads", null, function(err, heads) {
if (err) return cb(err);
cb(null, heads.map(function(head) {
var headParts = head.ref.split('/');
return headParts[headParts.length - 1];
return head.ref.replace(/^refs\/heads\//, '');
}));
});
};
Expand Down