Skip to content

Commit 46022ca

Browse files
carenasgitster
authored andcommitted
t: avoid alternation (not POSIX) in grep's BRE
f1e3df3 (t: increase test coverage of signature verification output, 2020-03-04) adds GPG dependent tests to t4202 and t6200 that were found problematic with at least OpenBSD 6.7. Using an escaped '|' for alternations works only in some implementations of grep (e.g. GNU and busybox). It is not part of POSIX[1] and not supported by some BSD, macOS, and possibly other POSIX compatible implementations. Use `grep -E`, and write it using extended regular expression. [1] https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap09.html#tag_09_03 Helped-by: Torsten Bögershausen <[email protected]> Signed-off-by: Carlo Marcelo Arenas Belón <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent fa82be9 commit 46022ca

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

t/t4202-log.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1643,7 +1643,7 @@ test_expect_success GPG 'log --graph --show-signature for merged tag with missin
16431643
GNUPGHOME=. git log --graph --show-signature -n1 plain-nokey >actual &&
16441644
grep "^|\\\ merged tag" actual &&
16451645
grep "^| | gpg: Signature made" actual &&
1646-
grep "^| | gpg: Can'"'"'t check signature: \(public key not found\|No public key\)" actual
1646+
grep -E "^| | gpg: Can'"'"'t check signature: (public key not found|No public key)" actual
16471647
'
16481648

16491649
test_expect_success GPG 'log --graph --show-signature for merged tag with bad signature' '

t/t6200-fmt-merge-msg.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ test_expect_success GPG 'message for merging local tag signed by unknown key' '
103103
GNUPGHOME=. git fmt-merge-msg <.git/FETCH_HEAD >actual 2>&1 &&
104104
grep "^Merge tag ${apos}signed-good-tag${apos}" actual &&
105105
grep "^# gpg: Signature made" actual &&
106-
grep "^# gpg: Can${apos}t check signature: \(public key not found\|No public key\)" actual
106+
grep -E "^# gpg: Can${apos}t check signature: (public key not found|No public key)" actual
107107
'
108108

109109
test_expect_success 'message for merging external branch' '

0 commit comments

Comments
 (0)