From f034ed60279370314fe4d2c063a45e59f5ca3c34 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Mon, 20 Jan 2014 14:43:48 +0100 Subject: [PATCH] do not merge, if not coming from the master branch Signed-off-by: Nico Schottelius --- bin/build-helper | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/bin/build-helper b/bin/build-helper index 389e7696..6210b907 100755 --- a/bin/build-helper +++ b/bin/build-helper @@ -205,25 +205,30 @@ eof fi # Ensure we are on the master branch + masterbranch=yes if [ "$(git rev-parse --abbrev-ref HEAD)" != "master" ]; then echo "Releases are happening from the master branch, aborting" echo "Enter the magic word to release anyway" read magicword - if [ "$magicword" != "iknowwhatido" ]; then + if [ "$magicword" = "iknowwhatido" ]; then + masterbranch=no + else exit 1 fi fi - # Ensure version branch exists - if ! git rev-parse --verify refs/heads/$target_branch 2>/dev/null; then - git branch "$target_branch" - fi + if [ "$masterbranch" = yes ]; then + # Ensure version branch exists + if ! git rev-parse --verify refs/heads/$target_branch 2>/dev/null; then + git branch "$target_branch" + fi - # Merge master branch into version branch - git checkout "$target_branch" - git merge master + # Merge master branch into version branch + git checkout "$target_branch" + git merge master + fi # Verify that after the merge everything works "$0" check-date