mirror of
https://github.com/NixOS/nix
synced 2025-07-07 06:01:48 +02:00
git fetcher: distinguish errors more precisely
This commit is contained in:
parent
c7e527b82b
commit
9504445cab
2 changed files with 25 additions and 9 deletions
|
@ -206,3 +206,11 @@ rev4_nix=$(nix eval --impure --raw --expr "(builtins.fetchGit { url = \"file://$
|
|||
# The name argument should be handled
|
||||
path9=$(nix eval --impure --raw --expr "(builtins.fetchGit { url = \"file://$repo\"; ref = \"HEAD\"; name = \"foo\"; }).outPath")
|
||||
[[ $path9 =~ -foo$ ]]
|
||||
|
||||
# should fail if there is no repo
|
||||
rm -rf $repo/.git
|
||||
(! nix eval --impure --raw --expr "(builtins.fetchGit \"file://$repo\").outPath")
|
||||
|
||||
# should succeed for a repo without commits
|
||||
git init $repo
|
||||
path10=$(nix eval --impure --raw --expr "(builtins.fetchGit \"file://$repo\").outPath")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue