Conversation
|
@qknight: I'm unable to reproduce this, $ nix-prefetch-git https://golang.org/x/net --rev 9831f2c3ac1068a78f50
Initialized empty Git repository in /tmp/git-checkout-tmp-AREolhSA/net-9831f2c/.git/
fatal: https://golang.org/x/net/info/refs not valid: is this a git repository?
fatal: https://golang.org/x/net/info/refs not valid: is this a git repository?
Unable to checkout 9831f2c3ac1068a78f50 from https://golang.org/x/net.
$ echo $?
1
$ You mention Do you have the output without these changes applied, but using |
| echo 1>&2 "Unable to checkout $hash$ref from $url." | ||
| exit 1 | ||
| ) | ||
| exit_status=$(checkout_ref "$hash" "$ref" || checkout_hash "$hash" "$ref") |
There was a problem hiding this comment.
i'm not sure if this is the proper solution but it seems to work. can someone confirm this is correct code?
|
@aszlig i've update the example and you should now be able to see that it is broken and that this PR fixes it. |
|
What is the status of this pull request? |
|
Closing due to lack of activity, feel free re-open this if needed. |
Motivation for this change
there is a bug in
nix-prefetch-gitwhich makes our implementation ofdep2niximpossible, since the error handling is not working at all.the cause for the problem is that
https://golang.org/x/netis not a git repository at all and thereforenix-prefetch-gitshould fail with an exit code != 0 which is not the case.the output before the change A
the output before the change A (with --quiet)
WARNING: exit code should still be 1 and not 0!
the output after the change B
the output after the change B (with --quiet)
Things done