aboutsummaryrefslogtreecommitdiff
path: root/tests/fetchGit.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tests/fetchGit.sh')
-rw-r--r--tests/fetchGit.sh8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/fetchGit.sh b/tests/fetchGit.sh
index ac0d78f12..d44586977 100644
--- a/tests/fetchGit.sh
+++ b/tests/fetchGit.sh
@@ -25,8 +25,16 @@ rev1=$(git -C $repo rev-parse HEAD)
echo world > $repo/hello
git -C $repo commit -m 'Bla2' -a
+git -C $repo worktree add $TEST_ROOT/worktree
+echo hello >> $TEST_ROOT/worktree/hello
rev2=$(git -C $repo rev-parse HEAD)
+# Fetch a worktree
+unset _NIX_FORCE_HTTP
+path0=$(nix eval --impure --raw --expr "(builtins.fetchGit file://$TEST_ROOT/worktree).outPath")
+export _NIX_FORCE_HTTP=1
+[[ $(tail -n 1 $path0/hello) = "hello" ]]
+
# Fetch the default branch.
path=$(nix eval --impure --raw --expr "(builtins.fetchGit file://$repo).outPath")
[[ $(cat $path/hello) = world ]]