From b31d761ac5ed987a929b3211fc0fad17482338f4 Mon Sep 17 00:00:00 2001 From: Chris Koeritz Date: Thu, 9 Nov 2017 18:02:49 -0500 Subject: [PATCH] added coolness checking branch name checks the branch name now so it will not do the pull origin master unless it actually needs to. --- scripts/rev_control/version_control.sh | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/scripts/rev_control/version_control.sh b/scripts/rev_control/version_control.sh index b19f9a42..be183ae1 100644 --- a/scripts/rev_control/version_control.sh +++ b/scripts/rev_control/version_control.sh @@ -209,6 +209,13 @@ function squash_first_few_crs() fi } +# a helpful method that reports the git branch for the current directory's +# git repository. +function git_branch_name() +{ + echo "$(git branch | grep \* | cut -d ' ' -f2-)" +} + # gets the latest versions of the assets from the upstream repository. function do_update() { @@ -240,8 +247,13 @@ function do_update() elif [ -d ".git" ]; then if test_writeable ".git"; then $blatt - git pull origin master 2>&1 | grep -v "X11 forwarding request failed" | squash_first_few_crs - retval=${PIPESTATUS[0]} + retval=0 + + if [ "$(git_branch_name)" != "master" ]; then + git pull origin master 2>&1 | grep -v "X11 forwarding request failed" | squash_first_few_crs + retval+=${PIPESTATUS[0]} + fi + git pull 2>&1 | grep -v "X11 forwarding request failed" | squash_first_few_crs retval+=${PIPESTATUS[0]} fi -- 2.34.1