1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-06 21:41:48 +02:00

fetchGit/fetchMercurial: Fix directory inclusion check

E.g. the existence of .gitignore would cause .git to be included.
This commit is contained in:
Eelco Dolstra 2017-11-21 19:12:47 +01:00
parent 6cdaa858d0
commit d7da6c9ea9
No known key found for this signature in database
GPG key ID: 8170B4726D7198DE
4 changed files with 12 additions and 6 deletions

View file

@ -16,7 +16,8 @@ git -C $repo config user.email "foobar@example.com"
git -C $repo config user.name "Foobar"
echo utrecht > $repo/hello
git -C $repo add hello
touch $repo/.gitignore
git -C $repo add hello .gitignore
git -C $repo commit -m 'Bla1'
rev1=$(git -C $repo rev-parse HEAD)
@ -68,6 +69,7 @@ path2=$(nix eval --raw "(builtins.fetchGit $repo).outPath")
[ ! -e $path2/hello ]
[ ! -e $path2/bar ]
[ ! -e $path2/dir2/bar ]
[ ! -e $path2/.git ]
[[ $(cat $path2/dir1/foo) = foo ]]
[[ $(nix eval --raw "(builtins.fetchGit $repo).rev") = 0000000000000000000000000000000000000000 ]]