From: Eric Sunshine Date: Mon, 20 Oct 2025 17:39:59 GMT Subject: Re: [PATCH] t7500: fix tests with absolute path following ":(optional)" on Windows Message-ID: In-Reply-To: On Mon, Oct 20, 2025 at 9:44 AM Ben Knoble wrote: > > Le 20 oct. 2025 à 05:40, Johannes Sixt a écrit : > > On Windows, the MSYS layer translates absolute path names generated by > > a shell script from the POSIX style /c/dir/file to the Windows style > > C:/dir/file form that is understood by git.exe. This happens only when > > the absolute path stands on its own as a program argument or a value of > > an environment variable. > > [...] > > Going forward I will probably stick with using pwd, given the difference in platform behavior. > > Is there a doc or test lint for that? If not, might be useful. The use of $PWD versus $(pwd) is documented in t/README: When a test checks for an absolute path that a git command generated, construct the expected value using $(pwd) rather than $PWD, $TEST_DIRECTORY, or $TRASH_DIRECTORY. It makes a difference on Windows, where the shell (MSYS bash) mangles absolute path names. For details, see the commit message of 4114156ae9. (Though, it might have been nicer if it described the behavior in more detail rather than referring the reader elsewhere.)