1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-08 02:43:54 +02:00

Split off the circular flake import tests

This commit is contained in:
Eelco Dolstra 2022-07-13 20:16:39 +02:00
parent c591efafd3
commit f011c269c9
4 changed files with 74 additions and 61 deletions

View file

@ -2,6 +2,13 @@ source ../common.sh
registry=$TEST_ROOT/registry.json
requireGit() {
if [[ -z $(type -p git) ]]; then
echo "Git not installed; skipping flake tests"
exit 99
fi
}
writeSimpleFlake() {
local flakeDir="$1"
cat > $flakeDir/flake.nix <<EOF
@ -34,3 +41,15 @@ writeDependentFlake() {
}
EOF
}
createGitRepo() {
local repo="$1"
local extraArgs="$2"
rm -rf $repo $repo.tmp
mkdir -p $repo
git -C $repo init $extraArgs
git -C $repo config user.email "foobar@example.com"
git -C $repo config user.name "Foobar"
}