Don't attempt to update remote head if pull fails

This commit is contained in:
Markus Olsson 2024-04-29 14:11:51 +02:00
parent 8461f421dc
commit 7a743489a1
2 changed files with 10 additions and 12 deletions

View file

@ -4653,21 +4653,18 @@ export class AppStore extends TypedBaseStore<IAppState> {
}
await gitStore.performFailableOperation(
() =>
pullRepo(repository, account, remote, progress => {
async () => {
await pullRepo(repository, account, remote, progress => {
this.updatePushPullFetchProgress(repository, {
...progress,
value: progress.value * pullWeight,
})
}),
{
gitContext,
retryAction,
}
})
await updateRemoteHEAD(repository, account, remote)
},
{ gitContext, retryAction }
)
await updateRemoteHEAD(repository, account, remote)
const refreshStartProgress = pullWeight + fetchWeight
const refreshTitle = __DARWIN__
? 'Refreshing Repository'

View file

@ -1060,11 +1060,12 @@ export class GitStore extends BaseStore {
repository: this.repository,
}
await this.performFailableOperation(
() => fetchRepo(this.repository, account, remote, progressCallback),
async () => {
await fetchRepo(this.repository, account, remote, progressCallback)
await updateRemoteHEAD(this.repository, account, remote)
},
{ backgroundTask, retryAction }
)
await updateRemoteHEAD(this.repository, account, remote)
}
/**