Created
December 3, 2012 04:28
-
-
Save timrchavez/4192700 to your computer and use it in GitHub Desktop.
Throw away the first two components, leaving the rest of the path as the branch "name"
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/github.js b/github.js | |
index cd1cf38..01c01db 100644 | |
--- a/github.js | |
+++ b/github.js | |
@@ -199,7 +199,7 @@ | |
this.listBranches = function(cb) { | |
_request("GET", repoPath + "/git/refs/heads", null, function(err, heads) { | |
if (err) return cb(err); | |
- cb(null, _.map(heads, function(head) { return _.last(head.ref.split('/')); })); | |
+ cb(null, _.map(heads, function(head) { return _.rest(head.ref.split('/'), 2).join('/'); })); | |
}); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment