]> git.ipfire.org Git - thirdparty/git.git/commitdiff
t/lib-gpg: fix setup of GNUPGHOME in MinGW
authorPatrick Steinhardt <ps@pks.im>
Wed, 16 Oct 2024 08:12:59 +0000 (10:12 +0200)
committerTaylor Blau <me@ttaylorr.com>
Wed, 16 Oct 2024 21:00:49 +0000 (17:00 -0400)
In "t/lib-gpg.sh" we set up the "GNUPGHOME" environment variable to
point to a test-specific directory. This is done by using "$PWD/gpghome"
as value, where "$PWD" is the current test's trash directory.

This is broken for MinGW though because "$PWD" will use Windows-style
paths that contain drive letters. What we really want in this context is
a Unix-style path, which we can get by using `$(pwd)` instead. It is
somewhat puzzling that nobody ever hit this issue, but it may easily be
that nobody ever tests on Windows with GnuPG installed, which would make
us skip those tests.

Adapt the code accordingly to fix tests using this library.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Taylor Blau <me@ttaylorr.com>
t/lib-gpg.sh

index add11e88fc00d7c452f62c0f6da0835fd12f53a2..3845b6ac449541aae309f502ab4b4484d5adf6b5 100644 (file)
@@ -6,7 +6,7 @@
 #   executed in an eval'ed subshell that changes the working directory to a
 #   temporary one.
 
-GNUPGHOME="$PWD/gpghome"
+GNUPGHOME="$(pwd)/gpghome"
 export GNUPGHOME
 
 test_lazy_prereq GPG '