Scrutinizer: allow / in branches everywhere

Part of #561.
This commit is contained in:
Thaddee Tyl 2015-12-16 00:00:29 +01:00
parent 6996879173
commit a1597955d6

View File

@ -2147,8 +2147,8 @@ cache(function(data, match, sendBadge, request) {
var slashesInRepo = 2;
if (repoParts[0] === 'gp') { slashesInRepo = 1; }
if ((repoParts.length - 1) > slashesInRepo) {
branch = repoParts[repoParts.length - 1];
repo = repoParts.slice(0, -1).join('/');
branch = repoParts.slice(slashesInRepo + 1).join('/');
repo = repoParts.slice(0, slashesInRepo + 1).join('/');
}
var apiUrl = 'https://scrutinizer-ci.com/api/repositories/' + repo;
var badgeData = getBadgeData('coverage', data);
@ -2186,8 +2186,8 @@ cache(function(data, match, sendBadge, request) {
var slashesInRepo = 2;
if (repoParts[0] === 'gp') { slashesInRepo = 1; }
if ((repoParts.length - 1) > slashesInRepo) {
branch = repoParts[repoParts.length - 1];
repo = repoParts.slice(0, -1).join('/');
branch = repoParts.slice(slashesInRepo + 1).join('/');
repo = repoParts.slice(0, slashesInRepo + 1).join('/');
}
var apiUrl = 'https://scrutinizer-ci.com/api/repositories/' + repo;
var badgeData = getBadgeData('build', data);