X-Git-Url: https://feistymeow.org/gitweb/?a=blobdiff_plain;f=scripts%2Frev_control%2Fversion_control.sh;h=9f955d28ab2d62d619f2bab9c7e0a7a65c186776;hb=0466d7ce1311f3c808e38a2b160e5c5c90b1699f;hp=b19f9a420626eb7f21ae890a9c05644e2218b230;hpb=2bc71ac15b2998f2039fcce754070bc954afa1c5;p=feisty_meow.git diff --git a/scripts/rev_control/version_control.sh b/scripts/rev_control/version_control.sh index b19f9a42..9f955d28 100644 --- a/scripts/rev_control/version_control.sh +++ b/scripts/rev_control/version_control.sh @@ -81,9 +81,16 @@ function do_checkin() # catch if the diff-index failed somehow. retval+=$? - # upload any changes to the upstream repo so others can see them. +#push the changes to where? locally? git push 2>&1 | grep -v "X11 forwarding request failed" | squash_first_few_crs retval+=${PIPESTATUS[0]} + + # upload any changes to the upstream repo so others can see them. + if [ "$(git_branch_name)" != "master" ]; then + git push origin "$(git_branch_name)" 2>&1 | grep -v "X11 forwarding request failed" | squash_first_few_crs + retval+=${PIPESTATUS[0]} + fi + fi else # nothing there. it's not an error though. @@ -209,6 +216,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 +254,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