Issue being fixed or feature implemented
With set -- A "$LINE" (quoted), the entire input line becomes $2 as a single string, leaving $3 and $4 empty. Since empty $4 never equals "refs/heads/master", the hook always continues, and the commit-signing verification never executes in either repo.
Using the unquoted form set -- A $LINE (no quotes), which relied on word-splitting to populate $2…$5 correctly, trips ShellCheck's SC2086 rule.
What was done?
Parse the fields directly with read:
The fix is both ShellCheck-compliant and functionally correct.
edit: Added # shellcheck disable=SC2034 to bypass false positive x not being used warning.
How Has This Been Tested?
Not tested. I initially PR'd this to Dash, but was recommended to PR to Bitcoin too, since it's inherited.
Breaking Changes
None.
Checklist:
Go over all the following points, and put an x in all the boxes that apply.
- I have performed a self-review of my own code
- I have commented my code, particularly in hard-to-understand areas
- I have added or updated relevant unit/integration/functional/e2e tests
- I have made corresponding changes to the documentation
- I have assigned this pull request to a milestone (for repository code-owners and collaborators only)