Add check to see if on master branch in msm

pull/1028/merge
Matthew D. Scholefield 2017-09-11 13:24:34 -05:00 committed by Steve Penrod
parent 72a318cd92
commit 5b31047ccd
1 changed files with 7 additions and 2 deletions

View File

@ -223,8 +223,13 @@ function update() {
echo "*.pyc" >> .git/info/exclude
fi
# Check if the repo is dirty or has commits to push
if [[ (-z $(git status --porcelain --untracked-files=no)) && !($LOCAL != $REMOTE && $REMOTE = $BASE) ]]; then
BRANCH="$(git symbolic-ref HEAD 2>/dev/null)"
BRANCH="${BRANCH##refs/heads/}"
if [[ (-z $(git status --porcelain --untracked-files=no)) && # No Modified files
!($LOCAL != $REMOTE && $REMOTE = $BASE) && # No new commits
"$BRANCH" = "master" ]] # On master branch
then
echo "Updating ${d}..."
echo -n " "
git fetch