Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix git loader to pass ref to fetchGit #648

Merged
merged 1 commit into from
Feb 7, 2020
Merged

Fix git loader to pass ref to fetchGit #648

merged 1 commit into from
Feb 7, 2020

Conversation

3noch
Copy link
Collaborator

@3noch 3noch commented Feb 7, 2020

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 like

fatal: not a tree object: 3f00db4a6e211d6e648f236c15eaf68c2dc8385e
error: program 'git' failed with exit code 128

It 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 as ref to builtins.fetchGit.

I have:

  • Looked for lint in my changes with hlint . (lint found code you did not write can be left alone)
  • Run the test suite: $(nix-build -A selftest --no-out-link)
  • (Optional) Run CI tests locally: nix-build release.nix -A build.x86_64-linux --no-out-link (or x86_64-darwin on macOS)

@3noch 3noch merged commit 311f537 into v0.5 Feb 7, 2020
@3noch 3noch deleted the eac@fix-fetchGit-ref branch February 7, 2020 03:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant