summaryrefslogtreecommitdiff
path: root/string-list.c
diff options
context:
space:
mode:
authorJohannes Sixt <j6t@kdbg.org>2025-10-20 11:40:08 +0200
committerJunio C Hamano <gitster@pobox.com>2025-10-20 09:16:49 -0700
commit91e6a645e75026a42977e37f24fca3f1fe54de58 (patch)
treee4baf41f8c9baadecaef4a5c3e3f1b3175ed3ef6 /string-list.c
parentccfcaf399ffcc91553395a8de8e833e7685e7cc2 (diff)
t7500: fix tests with absolute path following ":(optional)" on Windows
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. The earlier commits 749d6d166d (config: values of pathname type can be prefixed with :(optional), 2025-09-28) and ccfcaf399f (parseopt: values of pathname type can be prefixed with :(optional), 2025-09-28) added test cases where ":(optional)" is inserted before an absolute path. $PWD is used to construct the absolute paths, which gives the POSIX form, and the result is ":(optional)/c/dir/template". Such command line arguments are no longer recognized as absolute paths and do not undergo translation. Existing test cases that expect that the specified file does not exist are not incorrect (after all, git.exe will not find /c/dir/template). Yet, they are conceptually incorrect. That the use of $PWD is erroneous is revealed by a test case that expects that the optional file exists. Since no such test case is present, add one. Use "$(pwd)" to generate the absolute paths, so that the command line arguments become ":(optional)C:/dir/template". Signed-off-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'string-list.c')
0 files changed, 0 insertions, 0 deletions