Change in osmo-ci[master]: contrib/jenkins.sh: set-url for existing clones
osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ci/+/29774 ) Change subject: contrib/jenkins.sh: set-url for existing clones ...................................................................... contrib/jenkins.sh: set-url for existing clones Make sure that the recent change from git.osmocom.org -> gerrit.osmocom.org for git clone urls is applied to the existing clones as well. Change-Id: I3d9c193bf353ecff0ee8bb4c507de59139fc0925 --- M contrib/jenkins.sh 1 file changed, 12 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/74/29774/1 diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index 6512af9..96becc7 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -5,7 +5,18 @@ # Clone repository to ~/, or update existing # $1: name of osmocom project clone_repo() { - cd ~/"$1" || (cd ~/ && git clone https://gerrit.osmocom.org/"$1" && cd ~/"$1") + local project="$1" + local url="https://gerrit.osmocom.org/$project" + + if [ -d ~/"$project" ]; then + cd ~/"$project" + git remote set-url origin "$url" + else + cd ~ + git clone "$url" + cd "$project" + fi + git rev-parse HEAD git status -- To view, visit https://gerrit.osmocom.org/c/osmo-ci/+/29774 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Change-Id: I3d9c193bf353ecff0ee8bb4c507de59139fc0925 Gerrit-Change-Number: 29774 Gerrit-PatchSet: 1 Gerrit-Owner: osmith <osmith@sysmocom.de> Gerrit-MessageType: newchange
participants (1)
-
osmith