Fail gracefully if remote branch not found

This commit is contained in:
Mattias Granlund 2024-06-28 11:46:21 +02:00
parent 720e50d5a5
commit fd3e846989

View File

@ -87,17 +87,21 @@ export class VirtualBranchService {
.map(async (b) => {
const upstreamName = b.upstream?.name;
if (upstreamName) {
const data = await getRemoteBranchData(projectId, upstreamName);
const commits = data.commits;
commits.forEach((uc) => {
const match = b.commits.find((c) => commitCompare(uc, c));
if (match) {
match.relatedTo = uc;
uc.relatedTo = match;
}
});
linkAsParentChildren(commits);
b.upstreamData = data;
try {
const data = await getRemoteBranchData(projectId, upstreamName);
const commits = data.commits;
commits.forEach((uc) => {
const match = b.commits.find((c) => commitCompare(uc, c));
if (match) {
match.relatedTo = uc;
uc.relatedTo = match;
}
});
linkAsParentChildren(commits);
b.upstreamData = data;
} catch (e: any) {
console.log(e);
}
}
return b;
})