aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2017-11-03 13:48:02 +0100
committerEelco Dolstra <edolstra@gmail.com>2017-11-03 13:55:31 +0100
commitee6ac38848277d80c62fa5c2734ada1b5edc8680 (patch)
treeb334ed6f568806c94f7cfb135327060a04ab9db7 /tests
parent4dee01da7c7bc5d67dc916f159bfee8a873ac19b (diff)
fetchGit/fetchMercurial: Filter out directories with untracked files
Diffstat (limited to 'tests')
-rw-r--r--tests/fetchGit.sh9
-rw-r--r--tests/fetchMercurial.sh9
2 files changed, 12 insertions, 6 deletions
diff --git a/tests/fetchGit.sh b/tests/fetchGit.sh
index e2bb7b68c..a967380cd 100644
--- a/tests/fetchGit.sh
+++ b/tests/fetchGit.sh
@@ -57,15 +57,18 @@ path2=$(nix eval --raw "(builtins.fetchGit $repo).outPath")
[[ $path = $path2 ]]
# Using an unclean tree should yield the tracked but uncommitted changes.
-echo foo > $repo/foo
+mkdir $repo/dir1 $repo/dir2
+echo foo > $repo/dir1/foo
echo bar > $repo/bar
-git -C $repo add foo
+echo bar > $repo/dir2/bar
+git -C $repo add dir1/foo
git -C $repo rm hello
path2=$(nix eval --raw "(builtins.fetchGit $repo).outPath")
[ ! -e $path2/hello ]
[ ! -e $path2/bar ]
-[[ $(cat $path2/foo) = foo ]]
+[ ! -e $path2/dir2/bar ]
+[[ $(cat $path2/dir1/foo) = foo ]]
[[ $(nix eval --raw "(builtins.fetchGit $repo).rev") = 0000000000000000000000000000000000000000 ]]
diff --git a/tests/fetchMercurial.sh b/tests/fetchMercurial.sh
index 9c897ada9..0c9f4bdbb 100644
--- a/tests/fetchMercurial.sh
+++ b/tests/fetchMercurial.sh
@@ -58,15 +58,18 @@ path2=$(nix eval --raw "(builtins.fetchMercurial $repo).outPath")
[[ $path = $path2 ]]
# Using an unclean tree should yield the tracked but uncommitted changes.
-echo foo > $repo/foo
+mkdir $repo/dir1 $repo/dir2
+echo foo > $repo/dir1/foo
echo bar > $repo/bar
-hg add --cwd $repo foo
+echo bar > $repo/dir2/bar
+hg add --cwd $repo dir1/foo
hg rm --cwd $repo hello
path2=$(nix eval --raw "(builtins.fetchMercurial $repo).outPath")
[ ! -e $path2/hello ]
[ ! -e $path2/bar ]
-[[ $(cat $path2/foo) = foo ]]
+[ ! -e $path2/dir2/bar ]
+[[ $(cat $path2/dir1/foo) = foo ]]
[[ $(nix eval --raw "(builtins.fetchMercurial $repo).rev") = 0000000000000000000000000000000000000000 ]]