mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-22 14:06:16 +02:00
fetchTree/fetchGit: add test for .gitattributes
...with the intention to prevent future regressions in fetchGit
This commit is contained in:
parent
a38e6b9087
commit
4d0ecda33e
1 changed files with 9 additions and 0 deletions
|
@ -229,6 +229,15 @@ rev_tag2=$(git -C $repo rev-parse refs/tags/tag2)
|
||||||
[[ $rev_tag2_nix = $rev_tag2 ]]
|
[[ $rev_tag2_nix = $rev_tag2 ]]
|
||||||
unset _NIX_FORCE_HTTP
|
unset _NIX_FORCE_HTTP
|
||||||
|
|
||||||
|
# Ensure .gitattributes is respected
|
||||||
|
touch $repo/not-exported-file
|
||||||
|
echo "/not-exported-file export-ignore" >> $repo/.gitattributes
|
||||||
|
git -C $repo add not-exported-file .gitattributes
|
||||||
|
git -C $repo commit -m 'Bla6'
|
||||||
|
rev5=$(git -C $repo rev-parse HEAD)
|
||||||
|
path12=$(nix eval --impure --raw --expr "(builtins.fetchGit { url = file://$repo; rev = \"$rev5\"; }).outPath")
|
||||||
|
[[ ! -e $path12/not-exported-file ]]
|
||||||
|
|
||||||
# should fail if there is no repo
|
# should fail if there is no repo
|
||||||
rm -rf $repo/.git
|
rm -rf $repo/.git
|
||||||
(! nix eval --impure --raw --expr "(builtins.fetchGit \"file://$repo\").outPath")
|
(! nix eval --impure --raw --expr "(builtins.fetchGit \"file://$repo\").outPath")
|
||||||
|
|
Loading…
Reference in a new issue