fix(code): skip hook re-run when the branch is already on origin - #19
Merged
Conversation
3 tasks
Hook-fix verification used git push --dry-run, which re-executes the full pre-push suite. A flaky test timeout then aborted PR creation with a misleading "didn't amend" error even after the agent had already published HEAD. Treat origin/<branch> matching HEAD as success and skip the no-op follow-up push so hooks cannot flake twice.
danii1
force-pushed
the
fix/hook-fixer-already-pushed
branch
from
August 19, 2026 04:31
e8ab3bf to
8d3b401
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Hook-fix verification treated a failed
git push --dry-runas “the agent didn’t amend.” That dry-run re-runs the full pre-push suite. After Codex had already publishedfeature/dev-74, a 30s CLI test timeout (should handle task keys that look like options) failed the dry-run, there were no dirty files to amend, and PR creation aborted even though the branch was already on GitHub.Changes
HEADalready matchesorigin/<branch>, skip the hook-rerunning dry-run and treat verification as success.pushCurrentBranchalso skips a no-opgit pushin that case, so the follow-up push cannot flake the same way (a no-op push still invokes pre-push hooks).This is the failure that blocked DEV-74 from opening automatically.
Test plan
bun run test git-hook-fixer.test.ts protected-branch-safety.test.ts