Skip to content

Commit fd3e846

Browse files
committed
Fail gracefully if remote branch not found
1 parent 720e50d commit fd3e846

File tree

1 file changed

+15
-11
lines changed

1 file changed

+15
-11
lines changed

app/src/lib/vbranches/virtualBranch.ts

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -87,17 +87,21 @@ export class VirtualBranchService {
8787
.map(async (b) => {
8888
const upstreamName = b.upstream?.name;
8989
if (upstreamName) {
90-
const data = await getRemoteBranchData(projectId, upstreamName);
91-
const commits = data.commits;
92-
commits.forEach((uc) => {
93-
const match = b.commits.find((c) => commitCompare(uc, c));
94-
if (match) {
95-
match.relatedTo = uc;
96-
uc.relatedTo = match;
97-
}
98-
});
99-
linkAsParentChildren(commits);
100-
b.upstreamData = data;
90+
try {
91+
const data = await getRemoteBranchData(projectId, upstreamName);
92+
const commits = data.commits;
93+
commits.forEach((uc) => {
94+
const match = b.commits.find((c) => commitCompare(uc, c));
95+
if (match) {
96+
match.relatedTo = uc;
97+
uc.relatedTo = match;
98+
}
99+
});
100+
linkAsParentChildren(commits);
101+
b.upstreamData = data;
102+
} catch (e: any) {
103+
console.log(e);
104+
}
101105
}
102106
return b;
103107
})

0 commit comments

Comments
 (0)