|
|
|
@ -13,6 +13,11 @@ if [[ -z "$branch" ]] ||
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
# check git abilities
|
|
|
|
|
if [[ -n "`git status --help 2>/dev/null|grep -- '--ignore-submodules'`" ]]; then
|
|
|
|
|
GIT_IGNORE_SUBMODULES="--ignore-submodules"
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
echo "Preparing $PWD for development use"
|
|
|
|
|
if [[ $1 == "" ]]; then
|
|
|
|
|
gituser=`sed -n "/^\[remote \"origin\"\]/,/url/s/\turl = http:\/\/\([^@]*\)@.*/\1/p" <\`git rev-parse --git-dir\`/config | grep -v "\(anonymous\|system\)"`
|
|
|
|
@ -35,12 +40,12 @@ if [[ ! -e "$THISSCRIPT" ]]; then
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
if [[ ! -z "`git status --porcelain`" ]]; then
|
|
|
|
|
if [[ ! -z "`git status --porcelain $GIT_IGNORE_SUBMODULES`" ]]; then
|
|
|
|
|
git reset --hard HEAD
|
|
|
|
|
git clean -dxff
|
|
|
|
|
fi
|
|
|
|
|
git pull
|
|
|
|
|
if [[ ! -z "`git status --porcelain`" ]]; then
|
|
|
|
|
if [[ ! -z "`git status --porcelain $GIT_IGNORE_SUBMODULES`" ]]; then
|
|
|
|
|
git reset --hard HEAD
|
|
|
|
|
git clean -dxff
|
|
|
|
|
fi
|
|
|
|
|