summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-12-28 12:03:20 +0300
committerAndrei Karas <akaras@inbox.ru>2014-12-28 12:03:20 +0300
commita47ea35d4d872a389b792ecba9ebe05cae9b0243 (patch)
treea378e728c2f1d96477a8b1f79e1fdfe3831df005
parentcc5719a05f754e4f42395dc09761d22510aeb4cf (diff)
downloadall-a47ea35d4d872a389b792ecba9ebe05cae9b0243.tar.gz
all-a47ea35d4d872a389b792ecba9ebe05cae9b0243.tar.bz2
all-a47ea35d4d872a389b792ecba9ebe05cae9b0243.tar.xz
all-a47ea35d4d872a389b792ecba9ebe05cae9b0243.zip
Add into pull and status script checking for diverged branches.
-rwxr-xr-xpull.sh2
-rwxr-xr-xstatus.sh2
2 files changed, 2 insertions, 2 deletions
diff --git a/pull.sh b/pull.sh
index 68c1f93..2362ae4 100755
--- a/pull.sh
+++ b/pull.sh
@@ -13,7 +13,7 @@ function status {
return
fi
STR=$(git diff --name-only)
- STR2=$(git status|grep "Your branch is ahead")
+ STR2=$(git status|grep "Your branch is ahead")$(git status|grep -E "have diverged")
STR3=$(git status -s -uno)
if [[ -n "${STR}${STR2}${STR3}" ]]; then
echo -e "\e[1;31mCant pull because changes not pushed\e[0m"
diff --git a/status.sh b/status.sh
index e0be46a..6416e2c 100755
--- a/status.sh
+++ b/status.sh
@@ -7,7 +7,7 @@ function status {
DIR=$(pwd)
cd "$1"
STR=$(git diff --stat --color=always)
- STR2=$(git status|grep -E "Your branch is (behind|ahead)")
+ STR2=$(git status|grep -E "Your branch is (behind|ahead)")$(git status|grep -E "have diverged")
STR3=$(git status -s -uno)
if [[ "${CMD}" == "commit" || "${CMD}" == "c" ]]; then
COMMIT=$(git rev-parse HEAD)