diff --git a/src/WingetCreateCore/Common/GitHub.cs b/src/WingetCreateCore/Common/GitHub.cs index d6b46aad..bb8553e3 100644 --- a/src/WingetCreateCore/Common/GitHub.cs +++ b/src/WingetCreateCore/Common/GitHub.cs @@ -336,26 +336,24 @@ private async Task SubmitPRAsync(string packageId, string version, var upstreamMasterSha = upstreamMaster.Object.Sha; Reference newBranch = null; - bool forkSyncAttempted = false; - try { var retryPolicy = Policy .Handle() .Or() + .Or() .WaitAndRetryAsync(3, i => TimeSpan.FromSeconds(i)); await retryPolicy.ExecuteAsync(async () => { // Related issue: https://github.com/microsoft/winget-create/issues/282 // There is a known issue where a reference is unable to be created if the fork is behind by too many commits. - // Always attempt to sync fork during first execution in order to mitigate the possibility of this scenario occurring. + // Always attempt to sync fork in order to mitigate the possibility of this scenario occurring. // If the fork is behind by too many commits, syncing will also fail with a NotFoundException. // Updating the fork can fail if it is a non-fast forward update, but this should not be blocking as pull request submission can still proceed. // If creating a reference fails, that means syncing the fork also failed, therefore the user will need to manually sync their repo regardless. - if (!forkSyncAttempted && submitToFork) + if (submitToFork) { - forkSyncAttempted = true; await this.UpdateForkedRepoWithUpstreamCommits(repo); }