mirror of
https://github.com/gitbutlerapp/gitbutler.git
synced 2024-11-23 20:54:50 +03:00
Fail gracefully if remote branch not found
This commit is contained in:
parent
720e50d5a5
commit
fd3e846989
@ -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;
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user