aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorKjetil Orbekk <kj@orbekk.com>2021-04-20 07:52:50 -0400
committerKjetil Orbekk <kj@orbekk.com>2022-04-29 18:42:31 -0400
commit05a3fbac5a99e5738b951443afe17b680d5a7ead (patch)
tree7e277acf4bddb5800d4a259a49405c9bda629007 /tests
parent401e60f2893d689772f716cbd800ee2ee0309362 (diff)
Test fetchGit with non-'master' remote repo
Diffstat (limited to 'tests')
-rw-r--r--tests/fetchGit.sh8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/fetchGit.sh b/tests/fetchGit.sh
index 9179e2071..166bccfc7 100644
--- a/tests/fetchGit.sh
+++ b/tests/fetchGit.sh
@@ -161,6 +161,14 @@ path4=$(nix eval --impure --raw --expr "(builtins.fetchGit $repo).outPath")
[[ $(cat $path4/hello) = dev ]]
[[ $path3 = $path4 ]]
+# Using remote path with branch other than 'master' should fetch the HEAD revision.
+# (--tarball-ttl 0 to prevent using the cached repo above)
+export _NIX_FORCE_HTTP=1
+path4=$(nix eval --tarball-ttl 0 --impure --raw --expr "(builtins.fetchGit $repo).outPath")
+[[ $(cat $path4/hello) = dev ]]
+[[ $path3 = $path4 ]]
+unset _NIX_FORCE_HTTP
+
# Confirm same as 'dev' branch
path5=$(nix eval --impure --raw --expr "(builtins.fetchGit { url = $repo; ref = \"dev\"; }).outPath")
[[ $path3 = $path5 ]]