check-attribution-trailers.sh: fix broken remote-membership test

The origin-membership check used `case " $remotes " in *" origin "*)`,
padding $remotes (git remote's newline-separated output) with spaces.
That only puts literal spaces around the first and last entries, so with
more than one remote the case never matches, and the loop's
`[ "$r" = "origin" ] && continue` then discards origin permanently.
Result: a tree with origin plus any second remote hard-failed even
though origin resolved fine (argus's repro: aaa-dummy + origin).

Replace with a real membership test: grep -qx over one entry per line.
This commit is contained in:
atlas 2026-09-16 19:44:38 +02:00 committed by mara
commit 5be4210f51

View file

@ -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"