Subject: Re: [PATCH] test-lib: make sure TEST_DIRECTORY has no trailing slash

From: Junio C Hamano <[email-masked]>
Date: Wed, 04 Oct 2023 11:24:10 -0700

Štěpán Němec <[email-masked]> writes:

> The $PWD inside the test is the trash directory, though, so that's not
> the problematic $PWD with a trailing slash any more, so I guess this
> problem can't really happen in a test that follows the '. ./test-lib.sh'
> (which does cd -P "$TRASH_DIRECTORY") convention?

Yeah, after the dot-include of test-lib.sh returns, everything
should be safe.  What happens inside test-lib.sh (and worse yet,
inside future versions of that file) before that "cd -P" is what
the extra-carefulness protects against.