From 698830f87ee72f4009e72fe2e54da16cacfe621f 2020-06-29 04:17:29
From: Branko Majic <branko@majic.rs>
Date: 2020-06-29 04:17:29
Subject: [PATCH] Don't list keys used for encryption when decrypting a file.

---

diff --git a/openpgp/gitprotect.sh b/openpgp/gitprotect.sh
index 672c50860b31af79ba1f11c8733f86f1766550ce..3fde2c84f33929cc5c0c90e2ffb82c1d689bca4c 100755
--- a/openpgp/gitprotect.sh
+++ b/openpgp/gitprotect.sh
@@ -290,8 +290,8 @@ elif [[ $command = "decrypt" ]]; then
         filename=$(basename "$filePath" ".gpg")
 
         # Remove the "decrypted" file if decryption had failed.
-        if ! gpg2 --decrypt "$filePath" > "decrypted/$filename"; then
-            echo "ERROR: Failed to decrypt file '$filepath'. No private key available." >&2
+        if ! gpg2 --quiet --decrypt "$filePath" > "decrypted/$filename"; then
+            echo "ERROR: Failed to decrypt file '$filePath'. No private key available." >&2
             rm "decrypted/$filename"
         fi
     done < <(find . -maxdepth 1 -name '*.gpg')