diff --git a/scripts/check-attribution-trailers.sh b/scripts/check-attribution-trailers.sh index 6748e640..227139c6 100755 --- a/scripts/check-attribution-trailers.sh +++ b/scripts/check-attribution-trailers.sh @@ -39,9 +39,9 @@ if [ -n "${BASE_REF:-}" ]; then else remotes="$(git remote)" ordered_remotes="" - case " $remotes " in - *" origin "*) ordered_remotes="origin" ;; - esac + if printf '%s\n' "$remotes" | grep -qx origin; then + ordered_remotes="origin" + fi for r in $(printf '%s\n' "$remotes" | sort); do [ "$r" = "origin" ] && continue ordered_remotes="${ordered_remotes:+$ordered_remotes }$r"