2
0
mirror of https://github.com/tenrok/vue2-datepicker.git synced 2026-06-22 04:50:35 +03:00

build: add the check git shell

This commit is contained in:
mengxiong10
2019-04-30 20:01:44 +08:00
parent a1c3539c8c
commit 1909df9f78
2 changed files with 21 additions and 1 deletions
+20
View File
@@ -0,0 +1,20 @@
#!/bin/bash
# Check current branch
if test "master" != "$(git symbolic-ref --short HEAD)"; then
echo 'Not on `master` branch.' >&2;
exit 128;
fi
# Check local working tree
if test -n "$(git status --porcelain)"; then
echo 'Unclean working tree. Commit or stash changes first.' >&2;
exit 128;
fi
# Check remote history
if test "0" != "$(git rev-list --count --left-only @'{u}'...HEAD)"; then
echo 'Remote history differ. Please pull changes.' >&2;
exit 128;
fi