Support IGs with main not master

This commit is contained in:
Grahame Grieve 2022-05-06 10:00:04 +10:00
parent 30daa9dd26
commit d820260184
1 changed files with 6 additions and 1 deletions

View File

@ -529,7 +529,12 @@ public class FilesystemPackageCacheManager extends BasePackageCacheManager imple
checkBuildLoaded();
if (ciList.containsKey(id)) {
if (branch == null) {
InputStream stream = fetchFromUrlSpecific(Utilities.pathURL(ciList.get(id), "package.tgz"), false);
InputStream stream;
try {
stream = fetchFromUrlSpecific(Utilities.pathURL(ciList.get(id), "package.tgz"), false);
} catch (Exception e) {
stream = fetchFromUrlSpecific(Utilities.pathURL(ciList.get(id), "branches", "main", "package.tgz"), false);
}
return new InputStreamWithSrc(stream, Utilities.pathURL(ciList.get(id), "package.tgz"), "current");
} else {
InputStream stream = fetchFromUrlSpecific(Utilities.pathURL(ciList.get(id), "branches", branch, "package.tgz"), false);