Ed Page a7e0e44994
Revert "fix(package): detect dirtiness for symlinks to submodule" (#15419)
### What does this PR try to resolve?

This reverts commit 71ea2e5c5fa285e8e0336d51fd03ba4a427154bf.

`Repository::discover` and `Repository::status_file` are too expenstive
to run inside a loop. And `cargo package` are doing a lot of duplicate
works for checking submodule VCS status.

Alternative fixes might look like

* Let `status_submodules` function returns a path entry set, so
  Cargo can check whether a source file is dirty based on that.
* When listing files in `PathSource`, attach the VCS status of a
  path 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
d760263afb02c747a246bb0471a4f51e09075246

### Additional information

See
<https://github.com/rust-lang/cargo/issues/15384#issuecomment-2797064033>.
2025-04-11 18:41:15 +00:00
..