1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-25 06:31:14 +02:00

Apply makeNotAllowedError to empty repos

This commit is contained in:
Eelco Dolstra 2025-04-01 15:19:46 +02:00
parent 70dcd738ef
commit 67e957b636
6 changed files with 45 additions and 12 deletions

View file

@ -29,7 +29,8 @@ suites += {
'non-flake-inputs.sh',
'relative-paths.sh',
'symlink-paths.sh',
'debugger.sh'
'debugger.sh',
'source-paths.sh',
],
'workdir': meson.current_source_dir(),
}

View file

@ -0,0 +1,23 @@
#!/usr/bin/env bash
source ./common.sh
requireGit
repo=$TEST_ROOT/repo
createGitRepo "$repo"
cat > "$repo/flake.nix" <<EOF
{
outputs = { ... }: {
x = 1;
};
}
EOF
expectStderr 1 nix eval "$repo#x" | grepQuiet "error: Path 'flake.nix' in the repository \"$repo\" is not tracked by Git."
git -C "$repo" add flake.nix
[[ $(nix eval "$repo#x") = 1 ]]