From cde7d73594a3441e007f7af277bf3dea4adac36c Mon Sep 17 00:00:00 2001 From: Alfred Melch Date: Thu, 26 Aug 2021 12:30:24 +0200 Subject: [PATCH] prevent-foxtrot: format file --- pre-receive.d/prevent-foxtrot-merge.sh | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/pre-receive.d/prevent-foxtrot-merge.sh b/pre-receive.d/prevent-foxtrot-merge.sh index cb907df..21a3709 100755 --- a/pre-receive.d/prevent-foxtrot-merge.sh +++ b/pre-receive.d/prevent-foxtrot-merge.sh @@ -29,16 +29,15 @@ do # Should appear once as a parent # awk: print the second word # The second word is the first parent. Third word would be second parent, ... - MATCH=`git log --first-parent --pretty='%H %P' $oldrev..$newrev | - grep $oldrev | - awk '{ print $2 }'` - # First parent should be the oldrev - if [ "$oldrev" = "$MATCH" ]; then - exit 0 - else - echo >&2 "*** Push rejected! Foxtrot merge blocked! ***" - echo "See: https://blog.developer.atlassian.com/stop-foxtrots-now/" - exit 1 - fi + MATCH=`git log --first-parent --pretty='%H %P' $oldrev..$newrev | grep $oldrev | awk '{ print $2 }'` + + # First parent should be the oldrev + if [ "$oldrev" = "$MATCH" ]; then + exit 0 + else + echo >&2 "*** Push rejected! Foxtrot merge blocked! ***" + echo "See: https://blog.developer.atlassian.com/stop-foxtrots-now/" + exit 1 + fi fi done