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:
parent
d726682be4
commit
5be4210f51
1 changed files with 3 additions and 3 deletions
|
|
@ -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"
|
||||
|
|
|
|||
Loading…
Reference in a new issue