commit 9907c1e50ba225f29d2b0d4709e5d7749cbc9a22 parent 4f3dcb847295ce1ddf689783544767368f70fea7 Author: Natasha Kerensikova <natgh@instinctive.eu> Date: Sat, 2 Nov 2024 15:29:25 +0000 Flag terminator `--` is supported by mock-gpg Diffstat:
M | spec/support/bin/mock-gpg | | | 8 | +++++--- |
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/spec/support/bin/mock-gpg b/spec/support/bin/mock-gpg @@ -62,11 +62,13 @@ case "$1" in check_eq "$2" '--yes' "Unexpected gpg -d \$2: \"$2\"" check_eq "$3" '--compress-algo=none' "Unexpected gpg -d \$3: \"$3\"" check_eq "$4" '--no-encrypt-to' "Unexpected gpg -d \$4: \"$4\"" - @grep -v '^gpg' "$5" >&2 && die "Bad encrypted file \"$5\"" + shift 4 + [ "${1:-}" = '--' ] && shift + @grep -v '^gpg' -- "$1" >&2 && die "Bad encrypted file \"$1\"" if [ "${OUTPUT}" = '-' ]; then - @sed -n -- 's/^gpg://p' "$5" + @sed -n -- 's/^gpg://p' "$1" else - @sed -n -- 's/^gpg://p' "$5" >|"${OUTPUT}" + @sed -n -- 's/^gpg://p' "$1" >|"${OUTPUT}" fi ;; --list-config)