diff --git a/buildroot/share/git/mfpub b/buildroot/share/git/mfpub index 23e15c7f0..8ec28ad48 100755 --- a/buildroot/share/git/mfpub +++ b/buildroot/share/git/mfpub @@ -33,9 +33,9 @@ fi # Check out the named branch (or stay in current) if [[ $BRANCH != $CURR ]]; then - git checkout $BRANCH echo "Stashing any changes to files..." [[ $(git stash) != "No local "* ]] && HAS_STASH=1 + git checkout $BRANCH fi COMMIT=$( git log --format="%H" -n 1 ) @@ -135,4 +135,4 @@ git push -f upstream | { rm -rf ${TMPFOLDER} # Go back to the branch we started from -[[ $BRANCH != $CURR ]] && { git checkout $BRANCH ; [[ $HAS_STASH == 1 ]] && git stash pop ; } +[[ $BRANCH != $CURR ]] && git checkout $BRANCH && [[ $HAS_STASH == 1 ]] && git stash pop