Revert "fix(package): detect dirtiness for symlinks to submodule" #15419
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.
What does this PR try to resolve?
This reverts commit 71ea2e5.
Repository::discover
andRepository::status_file
are too expenstiveto run inside a loop. And
cargo package
are doing a lot of duplicateworks for checking submodule VCS status.
Alternative fixes might look like
status_submodules
function returns a path entry set, soCargo can check whether a source file is dirty based on that.
PathSource
, attach the VCS status of apath entry assoicated with. Then subsequent operations can skip
status check entirely.
However, the above solutions are not trivial, and the dirtiness check is
informational only based on T-cargo conclusion, so we should be
good just reverting the change now.
Again, the caveat of this is that we can't really detect
dirty symlinks that link into a Git submodule.
How should we test and review this PR?
Should be good to merge. We still got #15384 fixed via d760263
Additional information
See #15384 (comment).