From 47f1f918d45433c87a55cd5d2375aef9fc015c5f Mon Sep 17 00:00:00 2001 From: Rafa de la Torre Date: Thu, 11 Aug 2016 19:20:02 +0200 Subject: [PATCH] Do not check code is updated when not needed Particularly, when it is master or a detached HEAD (usually when checking out tags). --- check-up-to-date-with-master.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/check-up-to-date-with-master.sh b/check-up-to-date-with-master.sh index af4b8b4..2d8fcfe 100755 --- a/check-up-to-date-with-master.sh +++ b/check-up-to-date-with-master.sh @@ -1,5 +1,13 @@ #!/bin/bash +CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD) + +if [[ "$CURRENT_BRANCH" == "master" || "$CURRENT_BRANCH" == "HEAD" ]] +then + echo "master branch or detached HEAD" + exit 0 +fi + # Add remote-master git remote add -t master remote-master https://github.com/CartoDB/crankshaft.git