[package-deps-hash] Migrate from git ls-tree to git ls-files #5500
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.
Summary
The
git ls-treecommand has to read a collection of tree objects which can result in opening (and possibly fetching) a large number of packfiles. By comparison,git ls-filesonly has to read one file, the index (or multiple, if split index).Since the output of these commands is slightly different, parsing was updated to detect Git submodules based on the
objectmodefield instead of theobjecttypefield (which is available in Git 2.51.0, which is currently bleeding edge).Fixes #5499
Details
The unique
modevalue for Git submodules is160000and for symbolic links is120000.Updated
getDetailedRepoStateAsyncto parse out symbolic links to a separate map.How it was tested
This PR's build should have the rerun using the new version of Rush have the same cache keys.
Impacted documentation
API documentation for package-deps-hash.