Re: [PATCH] test-lib: make sure TEST_DIRECTORY has no trailing slash
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Oct 4, 2023, 18:24 UTC
- Message-ID
- <xmqqpm1up7p1.fsf@gitster.g>
- In-Reply-To
- <20231004194046+0200.353534-stepnem@smrk.net>
Štěpán Němec <stepnem@smrk.net> 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.