Skip to content

Commit f022780

Browse files
marcstraubeclaude
andauthored
fix(hooks): prevent post-merge hook failure on no dependency changes (#16)
## Summary - Fix `grep` exit code 1 propagating as hook failure when no dependency files changed - Add `|| true` to suppress non-zero exit from `grep` with no matches ## Test plan - [x] Merge a branch that doesn't change `package.json` or `pnpm-lock.yaml` — no hook error - [x] Merge a branch that changes dependencies — reminder message still shown 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent fc614eb commit f022780

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

.husky/post-merge

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/sh
22

33
# Check if package.json or pnpm-lock.yaml changed
4-
CHANGED=$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD 2>/dev/null | grep -E '^(package\.json|pnpm-lock\.yaml)$')
4+
CHANGED=$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD 2>/dev/null | grep -E '^(package\.json|pnpm-lock\.yaml)$' || true)
55

66
if [ -n "$CHANGED" ]; then
77
echo ""

0 commit comments

Comments
 (0)