]> Kevux Git Server - rit/commit
for-each-repo: test outside of repo context
authorDerrick Stolee <stolee@gmail.com>
Tue, 3 Mar 2026 17:31:51 +0000 (17:31 +0000)
committerJunio C Hamano <gitster@pobox.com>
Tue, 3 Mar 2026 18:19:59 +0000 (10:19 -0800)
commitc5e62e1aa07c7436cb081c7ef3a6995578f38b27
tree6f60c0091601a0b18adc0c52732b8ec4ee086c94
parent67ad42147a7acc2af6074753ebd03d904476118f
for-each-repo: test outside of repo context

The 'git for-each-repo' tool is frequently run outside of a repo context
in the real world. For example, it powers background maintenance.
Despite this typical case, we have not been testing it without a local
repository.

Update t0068 to stop creating a test repo and to use global config
everywhere. This has some subtle changes to test across the file.

This was noticed because an earlier attempt to remove the_repository
from builtin/for-each-repo.c did not catch a segmentation fault since
the passed 'repo' is NULL. This use of the_repository will need to stay
until we have a better way to handle config queries outside of a repo
context. Similar use still exists in builtin/config.c for the same
reason.

Signed-off-by: Derrick Stolee <stolee@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t0068-for-each-repo.sh