From 5a2917dc9db0ee7d45fbd29e05e4e3e75dcf2506 Mon Sep 17 00:00:00 2001 From: Denis Bilenko Date: Wed, 20 May 2026 14:39:16 +0200 Subject: [PATCH] acceptance: guard git-repo-init against running inside an existing repo git config silently writes to whatever repo CWD is in, so calling git-repo-init from inside an existing repo poisons that repo's config without any error signal. Co-authored-by: Isaac --- acceptance/script.prepare | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/acceptance/script.prepare b/acceptance/script.prepare index a8ea942bb4..fabd44d95e 100644 --- a/acceptance/script.prepare +++ b/acceptance/script.prepare @@ -49,6 +49,10 @@ trace() { } git-repo-init() { + if git rev-parse --git-dir > /dev/null 2>&1; then + echo "git-repo-init: already inside a git repository" >&2 + return 1 + fi git init -qb main git config core.autocrlf false git config user.name "Tester"