From 5be4210f5121f269a8c97ec667dbae1296dc5733 Mon Sep 17 00:00:00 2001 From: atlas Date: Wed, 16 Sep 2026 19:44:38 +0200 Subject: [PATCH] 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. --- scripts/check-attribution-trailers.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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"