diff --git a/switch_all_submodules_to_head_and_clean b/switch_all_submodules_to_head_and_clean index b41a392..c3fbde6 100755 --- a/switch_all_submodules_to_head_and_clean +++ b/switch_all_submodules_to_head_and_clean @@ -31,7 +31,7 @@ fi # get git user echobd "Preparing $(git rev-parse --show-toplevel | xargs -r basename) $branch branch for development use" if [[ $1 == "" ]]; then - gituser=`git config --local remote.origin.url | sed -n "s/https\?:\/\/\([^@]*\)@.*/\1/p" | grep -v "\(anonymous\|system\)"` + gituser=`git config --local remote.origin.url | sed -n "s|\(https\?://\)\?\([^@]*\)@.*|\2|p" | grep -v "\(anonymous\|system\)"` else gituser=$1 fi @@ -81,12 +81,12 @@ updateModule() { sed -i "s/system@/$gituser@/g" $PARENTDIR/$MODULE.gitmodules fi REPO_URL=$(git config --get remote.origin.url |\ - sed "s|\(https\?\)://\([^@]*@\)\?\(.*\)/[^/]*$|\3|") + sed "s|\(https\?://\)\?\([^@]*@\)\?\(.*\)/[^/]*$|\3|") REPO_PROTO=$(git config --get remote.origin.url |\ - sed "s|\(https\?\)://\([^@]*@\)\?\(.*\)/[^/]*$|\1|") + sed "s|\(https\?://\)\?\([^@]*@\)\?\(.*\)/[^/]*$|\1|") REPO_MASTER=scm.trinitydesktop.org/scm/git if [[ "$REPO_URL" != "$REPO_MASTER" ]]; then - sed -i "s#https\?://\([^@]*@\)\?$REPO_MASTER#$REPO_PROTO://\1$REPO_URL#g" $PARENTDIR/$MODULE.gitmodules + sed -i "s#https\?://\([^@]*@\)\?$REPO_MASTER#$REPO_PROTO\1$REPO_URL#g" $PARENTDIR/$MODULE.gitmodules fi sed -n "s|^\[submodule \"\([^\"]*\)\"\]$|\1|p" <$PARENTDIR/$MODULE.gitmodules |\ while read submodule; do