mirror of
https://git.savannah.gnu.org/git/coreutils.git
synced 2025-09-10 07:59:52 +02:00
maint: avoid :> pattern in tests
This was seen to trigger the EXIT trap on cygwin * cfg.mk (sc_prohibit_colon_redirection): Disallow all cases of :> in tests/ * tests/cksum/md5sum-bsd.sh: Adjust to avoid more stringent syntax check.
This commit is contained in:
5
cfg.mk
5
cfg.mk
@@ -144,9 +144,10 @@ sc_ensure_gl_diffs_apply_cleanly:
|
||||
done
|
||||
|
||||
# Avoid :>file which doesn't propagate errors
|
||||
# Also :>file was seen to trigger EXIT trap on cygwin
|
||||
sc_prohibit_colon_redirection:
|
||||
@cd $(srcdir)/tests && GIT_PAGER= git grep -En ': *>.*\|\|' \
|
||||
&& { echo '$(ME): '"The leading colon in :> will hide errors" >&2; \
|
||||
@cd $(srcdir)/tests && GIT_PAGER= git grep -En ': *>[^>]' \
|
||||
&& { echo '$(ME): '":> will hide errors or may trigger EXIT" >&2; \
|
||||
exit 1; } \
|
||||
|| :
|
||||
|
||||
|
||||
@@ -78,7 +78,7 @@ if echo '' > 'backslash\is\not\dir\sep'; then
|
||||
t=' '
|
||||
rm check.md5
|
||||
for i in 'a\b' 'a\' '\a' "a${nl}b" "a${t}b"; do
|
||||
: > "$i"
|
||||
rm -f "$i" && touch "$i"
|
||||
md5sum --tag "$i" >> check.md5 || fail=1
|
||||
done
|
||||
md5sum --strict -c check.md5 > out || fail=1
|
||||
|
||||
Reference in New Issue
Block a user