Fix incorrect handling when unfetched packages are deleted from upstream #2230
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR fixes a corner case that is not handled correctly. If the upstream package contains an unfetched subpackage, it will be fetched when the package is cloned (so similar to how
syncworks in old kpt). If this package is later deleted from upstream, it should only be deleted from local if there are no local changes. Currently this doesn't work correctly, since the package in origin will be unfetched and therefore running the diff will always show changes. With this change, the update logic will fetch the full package for origin before doing a diff.Fixes: #2216
Must merge after #2217