about summary refs log tree commit diff
path: root/tests/fetchGit.sh
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2018-01-09T15·49+0100
committerGitHub <noreply@github.com>2018-01-09T15·49+0100
commit3cd0704387eb10c4104ba06309ed38a6670b5660 (patch)
treeaffea3f6ff5060fa5569dbfcfe3f0f6fc28b0696 /tests/fetchGit.sh
parent7b9583680e9e1be1df2a5cd0d71ed8f9a7d45fad (diff)
parent428680b3076a01f278ed629aa3b1744d11a2c231 (diff)
Merge pull request #1787 from dtzWill/fix/git-not-on-PATH
fix git cache 'corruption' when git not available, breaks all future use of fetchGit
Diffstat (limited to 'tests/fetchGit.sh')
-rw-r--r--tests/fetchGit.sh13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/fetchGit.sh b/tests/fetchGit.sh
index 65d673c08854..b556fe594ce4 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 ]]