torproject / tor Public
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#29532: Update git pre-push hook so that only upstream branches can get pushed to origin #717
Conversation
15b39b0
to
30f669c
scripts/maint/pre-push.git-hook
Outdated
| @@ -52,6 +43,19 @@ do | |||
| range="$remote_sha..$local_sha" | |||
| fi | |||
|
|
|||
| if ref_is_upstream_branch "$local_ref" == 0 || | |||
Should we be checking local_ref at all, or only remote_ref ?
I suppose we should check both, to cover weird situations of local regular branch being pushed to remote upstream branch, and vice versa?
In that case, I think we should explicitly check for match; pushing maint-0.3.5 to maint-0.3.4 is as bad as pushing bug12345 to maint-0.3.4.
scripts/maint/pre-push.git-hook
Outdated
| ref_is_upstream_branch "$remote_ref" == 0 | ||
| if (ref_is_upstream_branch "$local_ref" == 0 || | ||
| ref_is_upstream_branch "$remote_ref" == 0) && | ||
| "$local_ref" ne "$remote_ref" |
Shellcheck does not complain about this, so I think not? Then again I'm really not sure.
On second thought, let's use [...] for consistency with previous code. See e28bbc8.
…ch names do not match
https://trac.torproject.org/projects/tor/ticket/29532
The text was updated successfully, but these errors were encountered: