diff options
Diffstat (limited to 'update_all_submodules')
-rwxr-xr-x | update_all_submodules | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/update_all_submodules b/update_all_submodules index 498dcef..563b3bd 100755 --- a/update_all_submodules +++ b/update_all_submodules @@ -19,12 +19,17 @@ 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 + touch /var/lock/update-tde-git-submodules PARENTDIR=$PWD echo "Working in $PARENTDIR" 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 @@ -44,7 +49,7 @@ do git submodule update fi cd $PARENTDIR/$DIR2UPDATE - if [[ ! -z "`git status --porcelain`" ]]; then + if [[ ! -z "`git status --porcelain $GIT_IGNORE_SUBMODULES`" ]]; then git reset --hard HEAD git clean -dxff fi |