Sync fork prior to creating reference and handle NotFoundException#289
Sync fork prior to creating reference and handle NotFoundException#289ryfu-msft merged 3 commits intomicrosoft:mainfrom
Conversation
|
I'm not sure how winget-create handles the forks and branches, but given that we have the upstream information in order to update the fork, couldn't the commit be applied directly to a detached head which is the latest commit to the default branch of upstream, removing the need to check if the fork is behind at all? |
Linking to the source code in case you were curious how it was implemented: winget-create/src/WingetCreateCore/Common/GitHub.cs Lines 278 to 378 in 49a1fb4 We already assign the new reference with the latest SHA1 value directly from the upstream default branch before attempting to create it. Even though we don't interact with the forked repo except when creating the new branch/reference, it seems like an outdated fork unintentionally impacts the |
Fixes #287
A NotFoundException occurs when the forked repo is behind by too many commits. This fails even when attempting to sync the forked repo with the upstream which nullifies my previous fix #235
To address this issue, I have added the following changes:
Current tests should verify that submission succeeds as this is a minor edge case that is difficult to replicate due to the requirement of the fork needing to be behind by X amount of commits.
Microsoft Reviewers: Open in CodeFlow