summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSlávek Banko <slavek.banko@axis.cz>2018-08-09 15:12:07 +0200
committerSlávek Banko <slavek.banko@axis.cz>2018-08-09 15:14:40 +0200
commit9be6e5e6f0f6396ac1922247a0718aadcadafe06 (patch)
tree14eb3a9697f108bd845c3fca43769e2304bb6ce2
parentc58fea63198d328eafcaded0d0092c4e2063d041 (diff)
downloadscripts-9be6e5e6f0f6396ac1922247a0718aadcadafe06.tar.gz
scripts-9be6e5e6f0f6396ac1922247a0718aadcadafe06.zip
Update switch_all_submodules_to_head_and_clean:r14.0.5
+ add support for cloning repositories via ssh Signed-off-by: Slávek Banko <slavek.banko@axis.cz> (cherry picked from commit f50efa7e809717d7c1c700eff7223da847f688e3)
-rwxr-xr-xswitch_all_submodules_to_head_and_clean8
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