Re: [PATCH v3 1/4] for-each-repo: test outside of repo context
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Mar 2, 2026, 18:31 UTC
- Message-ID
- <xmqqpl5m13s7.fsf@gitster.g>
- In-Reply-To
- <20260302175606.GB28275@coredump.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 17 quoted lines
> On Mon, Mar 02, 2026 at 03:36:42PM +0000, Derrick Stolee via GitGitGadget wrote: > >> test_description='git for-each-repo builtin' >> >> +# We need to test running 'git for-each-repo' outside of a repo context. >> +TEST_NO_CREATE_REPO=1 >> + >> . ./test-lib.sh > > Interesting. I was going to point out that this won't do what you want > by itself, because Git will keep walking out of the trash directory and > may find the containing repository. > > But it looks like this should be enough due to 614c3d8f2e (test-lib: set > GIT_CEILING_DIRECTORIES to protect the surrounding repository, > 2021-08-29). Supporting this case wasn't the intent of that patch, but I > don't see any reason why it should not work reliably.
I am surprised that use of GIT_CEILING_DIRECTORIES was not done until 2021, actually. The reason the configuration variable was invented for is exactly to avoid discovery processes going upward and ending up in a repository different from what we mean to work with.