Thread (13 messages) flat view 13 messages, 2 authors, 6d ago

Re: [PATCH 1/2] t7900: adapt some tests to use a throwaway repository

From: Patrick Steinhardt <hidden>
Date: 2026-08-12 10:07:30

On Wed, Aug 12, 2026 at 01:19:13AM -0700, Karthik Nayak wrote:
Patrick Steinhardt [off-list ref] writes:
quoted
diff --git a/t/t7900-maintenance.sh b/t/t7900-maintenance.sh
index 4238569b68..6735a9e082 100755
--- a/t/t7900-maintenance.sh
+++ b/t/t7900-maintenance.sh
@@ -67,41 +67,57 @@ test_expect_success 'run [--auto|--quiet] with gc strategy' '
[snip]
quoted
 test_expect_success 'maintenance.auto overrides gc.auto' '
-	test_when_finished "rm -f trace" &&
+	test_when_finished "rm -rf repo" &&
+	git init repo &&
+	(
+		cd repo &&

-	test_config maintenance.auto false &&
-	test_config gc.auto 1 &&
-	GIT_TRACE2_EVENT="$(pwd)/trace" git commit --quiet --allow-empty -m 1 &&
-	test_subcommand ! git maintenance run --auto --quiet --detach <trace &&
+		git config set maintenance.auto false &&
+		git config set gc.auto 1 &&
So we change from using `test_config` to `git config`, I assume this is
because earlier since we used a shared folder, we had to undo any config
changes made. Now that's no longer needed. Nit: This is okay, but
would've been nicer to call out.
The issue with `test_config` is that it executes `test_when_finished`,
and that function cannot run in subshells. So we have to use `git config
set` instead, but because it's a throw-away repository it doesn't
matter.

Patrick
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help