diff options
Diffstat (limited to 'scripts/check_upstream')
| -rwxr-xr-x | scripts/check_upstream | 13 |
1 files changed, 6 insertions, 7 deletions
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 @@ | |||
| 4 | # check $1(repo) if upstream branch origin/master is | 4 | # check $1(repo) if upstream branch origin/master is |
| 5 | # ahead of local branch $2(default to dev) | 5 | # ahead of local branch $2(default to dev) |
| 6 | 6 | ||
| 7 | if [ ! -d $1 ]; then | 7 | if [ ! -d "$1" ]; then |
| 8 | return 0 | 8 | return 0 |
| 9 | fi | 9 | fi |
| 10 | 10 | ||
| @@ -14,13 +14,12 @@ then | |||
| 14 | head=$2 | 14 | head=$2 |
| 15 | fi | 15 | fi |
| 16 | 16 | ||
| 17 | cd $1 | 17 | cd "$1" && \ |
| 18 | git pull my && \ | ||
| 18 | git fetch origin && \ | 19 | git fetch origin && \ |
| 19 | git rev-list $head | grep $(git rev-parse origin/master) > /dev/null | 20 | if git rev-list "$head" | grep "$(git rev-parse origin/master)" > /dev/null |
| 20 | |||
| 21 | if [ $? -ne 0 ] | ||
| 22 | then | 21 | then |
| 23 | echo "New commit at" $1 | 22 | echo "New commit at" "$1" |
| 24 | fi | 23 | fi |
| 25 | 24 | ||
| 26 | echo $(date) check $1 >> $SETTING_DIR/log | 25 | echo "$(date)" check "$1" >> "$SETTING_DIR/log" |