From: Thierry Parmentelat Date: Wed, 20 Oct 2010 09:42:26 +0000 (+0200) Subject: fix for when the target is a symlink in the middle of the git tree X-Git-Tag: foo~68 X-Git-Url: http://git.onelab.eu/?p=infrastructure.git;a=commitdiff_plain;h=d4a5e71ea1436be589ae6b0c521998275c0bcea1 fix for when the target is a symlink in the middle of the git tree --- diff --git a/scripts/auto-update.sh b/scripts/auto-update.sh index f2736b3..899f919 100755 --- a/scripts/auto-update.sh +++ b/scripts/auto-update.sh @@ -3,11 +3,12 @@ function _svn_or_git () { where="$1"; [ -z "$where" ] && where="." - cd $where + pushd $where >& /dev/null + cd $(pwd -P) while true; do - [ -d .svn ] && { echo svn ; return ; } - [ -d .git ] && { echo git ; return ; } - [ "$(pwd -P)" == "/" ] && { echo none ; return ; } + [ -d .svn ] && { popd >& /dev/null; echo svn ; return ; } + [ -d .git ] && { popd >& /dev/null; echo git ; return ; } + [ "$(pwd -P)" == "/" ] && { popd >& /dev/null; echo none ; return ; } cd .. done }