Fix tests breaking when checkout path contains shell metacharacters
[gitweb.git] / t / t7004-tag.sh
index 75cd33bde8e5906ad68ecdcc904248745d79975c..2dcee7ccc572bbc9b239ff805aede076ff926f49 100755 (executable)
@@ -578,6 +578,14 @@ test_expect_success \
        git diff expect actual
 '
 
+# subsequent tests require gpg; check if it is available
+gpg --version >/dev/null
+if [ $? -eq 127 ]; then
+       echo "gpg not found - skipping tag signing and verification tests"
+       test_done
+       exit
+fi
+
 # trying to verify annotated non-signed tags:
 
 test_expect_success \
@@ -600,13 +608,6 @@ test_expect_success \
 
 # creating and verifying signed tags:
 
-gpg --version >/dev/null
-if [ $? -eq 127 ]; then
-       echo "Skipping signed tags tests, because gpg was not found"
-       test_done
-       exit
-fi
-
 # As said here: http://www.gnupg.org/documentation/faqs.html#q6.19
 # the gpg version 1.0.6 didn't parse trust packets correctly, so for
 # that version, creation of signed tags using the generated key fails.
@@ -625,7 +626,8 @@ esac
 
 cp -R ../t7004 ./gpghome
 chmod 0700 gpghome
-export GNUPGHOME="$(pwd)/gpghome"
+GNUPGHOME="$(pwd)/gpghome"
+export GNUPGHOME
 
 get_tag_header signed-tag $commit commit $time >expect
 echo 'A signed tag message' >>expect