have hide -v show output from gnupg (#888)

* also document bug #834 and improve comments
pull/892/head
Josh Rabinowitz 2 years ago committed by GitHub
parent c5bf9958df
commit 77c0b27006
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -777,6 +777,7 @@ function _decrypt {
if [ ! -f "$encrypted_filename" ]; then
_warn_or_abort "cannot find file to decrypt: $encrypted_filename" "1" "$error_ok"
else
# we no longer use --no-permission-warning on decryption, for #811
local args=( "--use-agent" "--decrypt" )
if [[ "$write_to_file" -eq 1 ]]; then
@ -798,12 +799,11 @@ function _decrypt {
args+=( "--pinentry-mode" "loopback" )
fi
fi
if [[ -z "$_SECRETS_VERBOSE" ]]; then
# we no longer use --no-permission-warning here, for #811
args+=( "--quiet" )
fi
set +e # disable 'set -e' so we can capture exit_code
#echo "# gpg passphrase: $passphrase" >&3

@ -109,6 +109,7 @@ function hide {
# If -c option was provided, clean the hidden files
# before creating new ones.
# BUG: if passed files, we should only delete them, but we always delete all secret files; see issue #834
if [[ $clean -eq 1 ]]; then
_find_and_remove_secrets_formatted
fi
@ -169,6 +170,10 @@ function hide {
args+=( '--armor' )
fi
if [[ -n "$_SECRETS_VERBOSE" ]]; then
args+=( '--verbose' )
fi
# we depend on $recipients being split on whitespace
# shellcheck disable=SC2206
args+=( $recipients -o "$output_path" "$input_path" )

@ -53,7 +53,7 @@ function teardown {
}
@test "run 'cat' with wrong filename" {
@test "run 'cat' with bad filename" {
run git secret cat -d "$TEST_GPG_HOMEDIR" -p "$password" NO_SUCH_FILE
[ "$status" -eq 1 ]
}

@ -46,15 +46,11 @@ function teardown {
@test "run 'reveal' with bad arg" {
cp "$FILE_TO_HIDE" "${FILE_TO_HIDE}2"
rm -f "$FILE_TO_HIDE"
local password=$(test_user_password "$TEST_DEFAULT_USER")
run git secret reveal -Z -d "$TEST_GPG_HOMEDIR" -p "$password"
[ "$status" -ne 0 ]
}
@test "run 'reveal' on secret version of file" {
local password=$(test_user_password "$TEST_DEFAULT_USER")
run git secret reveal -d "$TEST_GPG_HOMEDIR" -p "$password" "$FILE_TO_HIDE$SECRETS_EXTENSION"

Loading…
Cancel
Save