From f5f05c0a9ef4814e5f2bd279f64ef5c71ea8fa52 Mon Sep 17 00:00:00 2001 From: Sven van Heugten Date: Mon, 2 Mar 2026 20:18:09 +0100 Subject: [PATCH] Set up the git repository in the bats file instead --- default.nix | 5 ----- test/git-check-assertions.bats | 6 ++++++ 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/default.nix b/default.nix index 47212a6..e159ff1 100644 --- a/default.nix +++ b/default.nix @@ -38,11 +38,6 @@ resholve.mkDerivation { checkPhase = '' runHook preCheck shellcheck bin/git-check-assertions test/git-check-assertions.bats - git init - git config user.email test - git config user.name test - git checkout -b main - git commit --allow-empty -m "initial" ./test/git-check-assertions.bats runHook postCheck ''; diff --git a/test/git-check-assertions.bats b/test/git-check-assertions.bats index 8de6cf7..f4b27e8 100755 --- a/test/git-check-assertions.bats +++ b/test/git-check-assertions.bats @@ -6,9 +6,15 @@ setup() { DIR="$( cd "$( dirname "$BATS_TEST_FILENAME" )" >/dev/null 2>&1 && pwd )" PATH="$DIR/../bin:$PATH" + + git init + git config user.email "john.doe@example.com" + git config user.name "John Doe" + git checkout -b main } @test "can run" { + git commit --allow-empty -m "Initial" run git-check-assertions assert_success }