Commit ee16b8d
committed
Merge #7264: refactor: pre-push-hook.sh potential regression
3b99477 refactor: fix a potential regression (Antonio Moratti)
Pull request description:
## 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.
## Breaking Changes
None.
## Checklist:
_Go over all the following points, and put an `x` in all the boxes that apply._
- [X] 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)_
ACKs for top commit:
UdjinM6:
LGTM but we inherited this code from [bitcoin](https://github.com/bitcoin/bitcoin) so you probably want to submit your fix there too.
utACK 3b99477
Tree-SHA512: c7106542572f022e3d36b58ecbbde8c2f1d5499af3d2c2c38aeeaf445bd55cfdf8ffd12e9a2bc4a193213a5a1f769bd062d35fe9157ca024bb201ef095f466051 file changed
Lines changed: 5 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
12 | | - | |
13 | | - | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
17 | 17 | | |
18 | | - | |
| 18 | + | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
0 commit comments