You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(hooks): guard-main-checkout-bash reads shell comments as text, not commands (#11129)
Both quote-aware passes (`split_segments()` and `tokenize()`) now apply the shell's
comment rule: outside quotes and heredoc bodies, an unquoted `#` that starts a WORD
begins a comment running to the next newline.
The word-start condition is the whole rule — `foo#bar`, `${x#y}`, `curl 'url/#frag'`,
`sed 's/#//'` and `grep '#'` are not comments and keep every verdict they had. In
`split_segments()` that means `{`/`}` do not reset word state (they are reserved words,
not metacharacters), so the `#` of `${#arr[@]}` cannot swallow a real redirect behind it.
Nothing changes about what the hook blocks once it has a real command; this is only about
what counts as a command. Self-test extended in both directions: 82 -> 100 cases.
Fixes#10570
Co-authored-by: Claude <noreply@anthropic.com>
0 commit comments