Re: [PATCH] t7900: use pwd -P in macOS maintenance test
- From
Mark Mentovai <mark@chromium.org>
- Date
- May 24, 2025, 04:39 UTC
- Message-ID
- <9e9ed1ce-76dc-536d-56a6-e85e1dfe58c6@chromium.org>
- In-Reply-To
- <xmqq7c27vvv3.fsf@gitster.g>
Junio C Hamano wrote:
Show 19 quoted lines
> Would doing something like this (without any other changes we > discussed so far) help? > > t/test-lib.sh | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git c/t/test-lib.sh w/t/test-lib.sh > index af722d383d..92d0db13d7 100644 > --- c/t/test-lib.sh > +++ w/t/test-lib.sh > @@ -1577,6 +1577,8 @@ fi > # Use -P to resolve symlinks in our working directory so that the cwd > # in subprocesses like git equals our $PWD (for pathname comparisons). > cd -P "$TRASH_DIRECTORY" || BAIL_OUT "cannot cd -P to \"$TRASH_DIRECTORY\"" > +TRASH_DIRECTORY=$(pwd) > +HOME="$TRASH_DIRECTORY" > > start_test_output "$0" >
That does work as an alternate way to fix the bug that I described.
Forcing the entire test suite to run from a realpath-canonicalized path seems like a blunt instrument, though. It would tend to mask bugs that only occur when git runs with a non-canonical path as its working directory. It could even mask bugs in git's own pathname canonicalization code.