diff options
author | Will Dietz <w@wdtz.org> | 2018-01-09 08:58:19 -0600 |
---|---|---|
committer | Will Dietz <w@wdtz.org> | 2018-01-09 08:58:19 -0600 |
commit | 84d9e213d2dc8b09705b0668184f33ddd0a004b1 (patch) | |
tree | 49fb9cfbc0b94870d845c26192ad3f306d90d5f2 /tests | |
parent | 7b9583680e9e1be1df2a5cd0d71ed8f9a7d45fad (diff) |
fetchGit.sh: Test we don't "corrupt" cache if invoke w/o git avail
Diffstat (limited to 'tests')
-rw-r--r-- | tests/fetchGit.sh | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/fetchGit.sh b/tests/fetchGit.sh index 65d673c08..b556fe594 100644 --- a/tests/fetchGit.sh +++ b/tests/fetchGit.sh @@ -119,3 +119,16 @@ path4=$(nix eval --raw "(builtins.fetchGit $repo).outPath") # Confirm same as 'dev' branch path5=$(nix eval --raw "(builtins.fetchGit { url = $repo; ref = \"dev\"; }).outPath") [[ $path3 = $path5 ]] + + +# Nuke the cache +rm -rf $TEST_HOME/.cache/nix/git + +# Try again, but without 'git' on PATH +NIX=$(command -v nix) +# This should fail +(! PATH= $NIX eval --raw "(builtins.fetchGit { url = $repo; ref = \"dev\"; }).outPath" ) + +# Try again, with 'git' available. This should work. +path5=$(nix eval --raw "(builtins.fetchGit { url = $repo; ref = \"dev\"; }).outPath") +[[ $path3 = $path5 ]] |