Commit 8b6df11
committed
fix(hooks): use portable for loop instead of process substitution in pre-push
The process substitution syntax `< <(...)` is bash-specific and causes
syntax errors when Git invokes the hook with sh on some systems.
Changed from:
while IFS= read -r commit_sha; do
...
done < <(git rev-list "$range")
To portable sh-compatible for loop:
for commit_sha in $(git rev-list "$range"); do
...
done
This solution:
- Works with any POSIX shell (sh, bash, dash, etc.)
- Avoids subshell creation (unlike pipe)
- Correctly propagates ERRORS variable to parent scope
- Fixes AI attribution detection that was failing silently1 parent ffe7e43 commit 8b6df11
1 file changed
+3
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
59 | | - | |
| 59 | + | |
| 60 | + | |
60 | 61 | | |
61 | 62 | | |
62 | 63 | | |
| |||
67 | 68 | | |
68 | 69 | | |
69 | 70 | | |
70 | | - | |
| 71 | + | |
71 | 72 | | |
72 | 73 | | |
73 | 74 | | |
| |||
0 commit comments