pre-push: Don't block pushes to canary for forked repos (#67946)
Our `pre-push` hook blocks accidental pushes to `canary` (see https://github.com/vercel/next.js/pull/66030 for context). This can be a bit annoying if the target remote is a fork -- we don't really need to protect those, we only care about the main repo. This PR changes the hook to only block pushes if the target remote is `vercel/next.js`. I also improved the branch checking logic to check if the _remote_ branch is `canary` -- previously, we'd only check the currently checked-out branch name, which means the hook wouldn't catch `git push origin mybranch:canary` (assuming `mybranch` is the currently checked out branch)
Showing
Please
register
or
sign in
to comment