aboutsummaryrefslogtreecommitdiffhomepage
path: root/scripts/check_upstream.sh
diff options
context:
space:
mode:
authortypebrook <typebrook@gmail.com>2019-11-09 23:47:28 +0800
committertypebrook <typebrook@gmail.com>2019-11-09 23:47:28 +0800
commit4f8f16e018f5eefc207d8bc59422fb2145595588 (patch)
tree5b61b27b84027c94a1ff337cb615232c73e565c4 /scripts/check_upstream.sh
parentd70ecd3278c17f222b513008820a9cf43914ec03 (diff)
update
Diffstat (limited to 'scripts/check_upstream.sh')
-rwxr-xr-xscripts/check_upstream.sh36
1 files changed, 18 insertions, 18 deletions
diff --git a/scripts/check_upstream.sh b/scripts/check_upstream.sh
index c08b3cf..9f20037 100755
--- a/scripts/check_upstream.sh
+++ b/scripts/check_upstream.sh
@@ -1,27 +1,27 @@
1#! /bin/bash
2
1# This script is for repo forked from others 3# This script is for repo forked from others
2# check $1(repo) if upstream branch origin/master is 4# check $1(repo) if upstream branch origin/master is
3# ahead of local branch $2(default to dev) 5# ahead of local branch $2(default to dev)
4 6
5check_upstream() {
6 7
7 if [ ! -d $1 ]; then 8if [ ! -d $1 ]; then
8 return 0 9 return 0
9 fi 10fi
10 11
11 head='dev' 12head='dev'
12 if [ $# -eq 2 ] 13if [ $# -eq 2 ]
13 then 14then
14 head=$2 15 head=$2
15 fi 16fi
16 17
17 cd $1 18cd $1
18 git fetch origin && \ 19git fetch origin && \
19 git rev-list $head | grep $(git rev-parse origin/master) > /dev/null 20git rev-list $head | grep $(git rev-parse origin/master) > /dev/null
20 21
21 if [ $? -ne 0 ] 22if [ $? -ne 0 ]
22 then 23then
23 echo "New commit at" $1 24 echo "New commit at" $1
24 fi 25fi
25 26
26 echo $(date) check $1 >> $SETTING_DIR/log 27echo $(date) check $1 >> $SETTING_DIR/log
27}