summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSlávek Banko <slavek.banko@axis.cz>2015-12-02 22:53:00 +0100
committerSlávek Banko <slavek.banko@axis.cz>2015-12-02 22:57:35 +0100
commit8eb2ea0f54d2162a616a28d02edd129b5d1c5486 (patch)
treea7f67096b800ef2f76aa1f2024d0a641f1f5e38d
parent6d53459401fc15137b68432053bdea3c3c7d0ec2 (diff)
downloadscripts-8eb2ea0f54d2162a616a28d02edd129b5d1c5486.tar.gz
scripts-8eb2ea0f54d2162a616a28d02edd129b5d1c5486.zip
switch_all_submodules_to_head_and_clean: Add support to clone from mirrorr14.0.3
Signed-off-by: Slávek Banko <slavek.banko@axis.cz> (cherry picked from commit 980d8ea3f8929655d0f135cde0f788b30ed558dc)
-rwxr-xr-xswitch_all_submodules_to_head_and_clean8
1 files changed, 8 insertions, 0 deletions
diff --git a/switch_all_submodules_to_head_and_clean b/switch_all_submodules_to_head_and_clean
index e41f550..3aaec01 100755
--- a/switch_all_submodules_to_head_and_clean
+++ b/switch_all_submodules_to_head_and_clean
@@ -56,6 +56,14 @@ if [[ -e .gitmodules ]]; then
else
sed -i "s/system@/$gituser@/g" .gitmodules
fi
+ REPO_URL=$(git config --get remote.origin.url |\
+ sed "s|\(https\?\)://\([^@]*@\)\?\(.*\)/[^/]*$|\3|")
+ REPO_PROTO=$(git config --get remote.origin.url |\
+ 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" .gitmodules
+ fi
git submodule init
git submodule update