diff options
author | Slávek Banko <slavek.banko@axis.cz> | 2018-08-09 15:12:07 +0200 |
---|---|---|
committer | Slávek Banko <slavek.banko@axis.cz> | 2018-08-09 15:12:07 +0200 |
commit | f50efa7e809717d7c1c700eff7223da847f688e3 (patch) | |
tree | 14eb3a9697f108bd845c3fca43769e2304bb6ce2 /switch_all_submodules_to_head_and_clean | |
parent | a04af5586759094483cd1aeece37530a76a2f1d4 (diff) | |
download | scripts-f50efa7e809717d7c1c700eff7223da847f688e3.tar.gz scripts-f50efa7e809717d7c1c700eff7223da847f688e3.zip |
Update switch_all_submodules_to_head_and_clean:
+ add support for cloning repositories via ssh
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
Diffstat (limited to 'switch_all_submodules_to_head_and_clean')
-rwxr-xr-x | switch_all_submodules_to_head_and_clean | 8 |
1 files changed, 4 insertions, 4 deletions
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 |