From 0dd86f8d5cdef3e62d3f6fd35870f92fd71da883 Mon Sep 17 00:00:00 2001 From: typebrook Date: Mon, 17 Feb 2020 08:42:44 +0800 Subject: update --- scripts/check_upstream | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'scripts') diff --git a/scripts/check_upstream b/scripts/check_upstream index e96a450..2c5fef0 100755 --- a/scripts/check_upstream +++ b/scripts/check_upstream @@ -4,7 +4,7 @@ # check $1(repo) if upstream branch origin/master is # ahead of local branch $2(default to dev) -if [ ! -d $1 ]; then +if [ ! -d "$1" ]; then return 0 fi @@ -14,13 +14,12 @@ then head=$2 fi -cd $1 +cd "$1" && \ +git pull my && \ git fetch origin && \ -git rev-list $head | grep $(git rev-parse origin/master) > /dev/null - -if [ $? -ne 0 ] +if git rev-list "$head" | grep "$(git rev-parse origin/master)" > /dev/null then - echo "New commit at" $1 + echo "New commit at" "$1" fi -echo $(date) check $1 >> $SETTING_DIR/log +echo "$(date)" check "$1" >> "$SETTING_DIR/log" -- cgit v1.2.3-70-g09d2