Improve support for git reference kinds (branch
, tag
, rev
), improve fetching behaviour
#1045
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.
Previously, we initialised the temporary git repository with a
clone
operation. By default, this only fetches a subset of git references, meaning that using references other than those provided by default withclone
failed to resolve.Inspired by cargo, this commit updates the behaviour to instead first initialise the repository, then attempt to fetch only those references that are relevant to the user specified git reference.
In order to construct an accurate set of
refspecs
and fetch only the relevant commits, its useful to retain knowledge about the kind of git reference. This introduces a newGitReference
type and updates the git source lock file serialization to account for this.The lock files of all examples and tests have been updated for the new approach to serializing the pinned git sources.
Closes #1019
Closes #1016
Unblocks #978