mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-12-27 05:43:50 +03:00
nix-prefetch-git: fix printing of revision
If the user explictly gives a ref such as "refs/heads/master", `git rev-parse` failed because we only checked out the `fetchgit` branch. Now, we also try `git rev-parse fetchgit` if the first call fails, which fixes the issue.
This commit is contained in:
parent
a46c4d976c
commit
be25ce8f58
@ -217,7 +217,7 @@ clone_user_rev() {
|
|||||||
fi;;
|
fi;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
echo "git revision is $(cd $dir && git rev-parse $rev)"
|
echo "git revision is $(cd $dir && (git rev-parse $rev 2> /dev/null || git rev-parse refs/heads/fetchgit) | tail -n1)"
|
||||||
|
|
||||||
# Allow doing additional processing before .git removal
|
# Allow doing additional processing before .git removal
|
||||||
eval "$NIX_PREFETCH_GIT_CHECKOUT_HOOK"
|
eval "$NIX_PREFETCH_GIT_CHECKOUT_HOOK"
|
||||||
|
Loading…
Reference in New Issue
Block a user