Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Schindelin <johannes.schindelin@gmx.de>2023-02-15 08:58:34 +0300
committerJunio C Hamano <gitster@pobox.com>2023-02-15 19:55:24 +0300
commitad6b320756d8d9150291c696a02c86d1c2f0f4b2 (patch)
tree1efd328960fdc24c9e74faadbf740d0ccb72e269 /t/t7510-signed-commit.sh
parent8300d15d5ecea1e41b2b1d381238ccaaec501dd4 (diff)
gpg: do show gpg's error message upon failure
There are few things more frustrating when signing a commit fails than reading a terse "error: gpg failed to sign the data" message followed by the unsurprising "fatal: failed to write commit object" message. In many cases where signing a commit or tag fails, `gpg` actually said something helpful, on its stderr, and Git even consumed that, but then keeps mum about it. Teach Git to stop withholding that rather important information. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t7510-signed-commit.sh')
-rwxr-xr-xt/t7510-signed-commit.sh10
1 files changed, 9 insertions, 1 deletions
diff --git a/t/t7510-signed-commit.sh b/t/t7510-signed-commit.sh
index 24dc3ef0a2..1d41683119 100755
--- a/t/t7510-signed-commit.sh
+++ b/t/t7510-signed-commit.sh
@@ -399,6 +399,10 @@ test_expect_success 'custom `gpg.program`' '
case "$1" in
-bsau)
+ test -z "$LET_GPG_PROGRAM_FAIL" || {
+ echo "zOMG signing failed!" >&2
+ exit 1
+ }
cat >sign.file
echo "[GNUPG:] SIG_CREATED $args" >&2
echo "-----BEGIN PGP MESSAGE-----"
@@ -420,7 +424,11 @@ test_expect_success 'custom `gpg.program`' '
git commit -S --allow-empty -m signed-commit &&
test_path_exists sign.file &&
git show --show-signature &&
- test_path_exists verify.file
+ test_path_exists verify.file &&
+
+ test_must_fail env LET_GPG_PROGRAM_FAIL=1 \
+ git commit -S --allow-empty -m must-fail 2>err &&
+ grep zOMG err
'
test_done