This commit is contained in:
Ladislau Szomoru 2023-05-31 15:48:04 +02:00 committed by GitHub
parent 207c1b956e
commit 8602b29876
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -285,7 +285,7 @@ async function createCheckoutItems(repository: Repository, detached = false): Pr
const buttons = await getRemoteRefItemButtons(repository);
let fallbackRemoteButtons: RemoteSourceActionButton[] | undefined = [];
const remote = repository.remotes.find(r => r.pushUrl === repository.HEAD?.remote || r.fetchUrl === repository.HEAD?.remote) ?? repository.remotes[0];
const remoteUrl = remote.pushUrl ?? remote.fetchUrl;
const remoteUrl = remote?.pushUrl ?? remote?.fetchUrl;
if (remoteUrl) {
fallbackRemoteButtons = buttons.get(remoteUrl);
}