Fix git loader to pass ref to fetchGit #648
Merged
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.
The new git loader uses
builtins.fetchGit
for private repos. Now that v0.5 actually marks repos private (whereas it this was always disabled before), we're getting more test coverage of this loader. We've found that it gets stuck when downloading a rev that it's never seen before and is also not in the history of the default branch. You end up getting an error likeIt turns out that
builtins.fetchGit
does a shallow clone on the given ref and then searches for the given rev. So you must make sure that your ref contains the rev, and passing no ref assumes the default branch.This fix adds a new git loader to fix this issue by passing
branch
asref
tobuiltins.fetchGit
.I have:
hlint .
(lint found code you did not write can be left alone)$(nix-build -A selftest --no-out-link)
nix-build release.nix -A build.x86_64-linux --no-out-link
(orx86_64-darwin
on macOS)