Skip to content

Run the pre-push warning test through Git when sh is off PATH - #495

Merged
abogartz merged 1 commit into
abogartz:mainfrom
WhollyMindless:test/pre-push-hook-windows
Nov 22, 2026
Merged

abogartz merged 1 commit into
abogartz:mainfrom
WhollyMindless:test/pre-push-hook-windows

Conversation

@WhollyMindless

Copy link
Copy Markdown
Contributor

Closes #494.

The runtime test for the pre-push warning used to skip whenever Bun could not find sh on PATH. In PowerShell, Git for Windows can still run the hook in that configuration.

This updates the test to initialize a temporary Git repository when sh is missing and invoke the tracked hook with git -c core.hooksPath=… hook run pre-push. The hook path applies only to that invocation. The test checks the same exit code and user-visible warning with either runner, reading stderr when Git forwards the hook output there. The change is confined to the test file.

Local verification on Windows with Bun 1.4.4 and Git 2.53.0.windows.2, using bun test test/host/pre-push-hook-message.test.ts:

Tools on PATH Result
Git, no sh 3 passed and 1 skipped on the base, all 4 passed on this branch
Git and sh All 4 passed
Neither Git nor sh 3 passed, 1 skipped

Typecheck and Biome passed. A dry-run push to a local bare repository also printed the expected warning with SKIP_GATE=1.

@abogartz
abogartz merged commit 00cc338 into abogartz:main Nov 22, 2026
4 checks passed
@abogartz-opencode-self-improvement

Copy link
Copy Markdown

🎉 This PR is included in version 0.34.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Pre-push warning test skips on Windows when Git can run the hook

2 participants