mirror of
https://github.com/desktop/desktop
synced 2024-09-13 21:31:32 +00:00
Don't run updateRemoteHEAD inside performFailableOperation scope
We don't want an error from updateRemoteHEAD to bubble up to a user prompt
This commit is contained in:
parent
8476019992
commit
51a5ee4b0e
|
@ -4658,7 +4658,7 @@ export class AppStore extends TypedBaseStore<IAppState> {
|
|||
this.statsStore.increment('pullWithDefaultSettingCount')
|
||||
}
|
||||
|
||||
await gitStore.performFailableOperation(
|
||||
const pullSucceeded = await gitStore.performFailableOperation(
|
||||
async () => {
|
||||
await pullRepo(repository, account, remote, progress => {
|
||||
this.updatePushPullFetchProgress(repository, {
|
||||
|
@ -4666,11 +4666,25 @@ export class AppStore extends TypedBaseStore<IAppState> {
|
|||
value: progress.value * pullWeight,
|
||||
})
|
||||
})
|
||||
await updateRemoteHEAD(repository, account, remote, false)
|
||||
return true
|
||||
},
|
||||
{ gitContext, retryAction }
|
||||
)
|
||||
|
||||
// If the pull failed we shouldn't try to update the remote HEAD
|
||||
// because there's a decent chance that it failed either because we
|
||||
// didn't have the correct credentials (which we won't this time
|
||||
// either) or because there's a network error which likely will
|
||||
// persist for the next operation as well.
|
||||
if (pullSucceeded) {
|
||||
// Updating the local HEAD symref isn't critical so we don't want
|
||||
// to show an error message to the user and have them retry the
|
||||
// entire pull operation if it fails.
|
||||
await updateRemoteHEAD(repository, account, remote, false).catch(
|
||||
e => log.error('Failed updating remote HEAD', e)
|
||||
)
|
||||
}
|
||||
|
||||
const refreshStartProgress = pullWeight + fetchWeight
|
||||
const refreshTitle = __DARWIN__
|
||||
? 'Refreshing Repository'
|
||||
|
|
|
@ -1060,13 +1060,27 @@ export class GitStore extends BaseStore {
|
|||
type: RetryActionType.Fetch,
|
||||
repository: repo,
|
||||
}
|
||||
await this.performFailableOperation(
|
||||
const pullSucceeded = await this.performFailableOperation(
|
||||
async () => {
|
||||
await fetchRepo(repo, account, remote, progressCallback, backgroundTask)
|
||||
await updateRemoteHEAD(repo, account, remote, backgroundTask)
|
||||
return true
|
||||
},
|
||||
{ backgroundTask, retryAction }
|
||||
)
|
||||
|
||||
// If the pull failed we shouldn't try to update the remote HEAD
|
||||
// because there's a decent chance that it failed either because we
|
||||
// didn't have the correct credentials (which we won't this time
|
||||
// either) or because there's a network error which likely will
|
||||
// persist for the next operation as well.
|
||||
if (pullSucceeded) {
|
||||
// Updating the local HEAD symref isn't critical so we don't want
|
||||
// to show an error message to the user and have them retry the
|
||||
// entire pull operation if it fails.
|
||||
await updateRemoteHEAD(repo, account, remote, backgroundTask).catch(e =>
|
||||
log.error('Failed updating remote HEAD', e)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue