From 7f0516022bb84378df13136273b42019e54157f9 Mon Sep 17 00:00:00 2001 From: rl1987 Date: Fri, 22 Feb 2019 17:05:07 +0200 Subject: [PATCH] Also disallow pushing to/from upstream branch when branch names do not match --- scripts/maint/pre-push.git-hook | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/maint/pre-push.git-hook b/scripts/maint/pre-push.git-hook index 24043978b6..e7a72efa08 100755 --- a/scripts/maint/pre-push.git-hook +++ b/scripts/maint/pre-push.git-hook @@ -44,8 +44,9 @@ do range="$remote_sha..$local_sha" fi - if ref_is_upstream_branch "$local_ref" == 0 || - ref_is_upstream_branch "$remote_ref" == 0 + if (ref_is_upstream_branch "$local_ref" == 0 || + ref_is_upstream_branch "$remote_ref" == 0) && + [ "$local_ref" != "$remote_ref" ] then if [ "$remote" == "origin" ] then