set pushurl from pullurl when configured

This commit is contained in:
Jakobus Schürz 2023-01-23 08:30:31 +01:00 committed by Jakobus Schürz
parent ef7b6059ca
commit 354ed21889

View file

@ -1351,7 +1351,13 @@ setgitremote() {
git remote set-url ${MSC_GIT_REMOTE_NAME:-$MSC_GIT_REMOTE_NAME_DEFAULT} ${MSC_GIT_PULLURL:-$MSC_GIT_PULLURL_DEFAULT} git remote set-url ${MSC_GIT_REMOTE_NAME:-$MSC_GIT_REMOTE_NAME_DEFAULT} ${MSC_GIT_PULLURL:-$MSC_GIT_PULLURL_DEFAULT}
git remote set-url --push ${MSC_GIT_REMOTE_NAME:-$MSC_GIT_REMOTE_NAME_DEFAULT} ${MSC_GIT_PUSHURL:-$MSC_GIT_PUSHURL_DEFAULT} # sequence for push-url
# configured pushurl from .bashrc
# configured pullurl from .bashrc (if no pushrul is defined and pushurl is the same as pullurl)
# default pushurl (if no push or pullurl is defined in .bashrc)
# default pullurl (if no push/pull/default_pushurl is defined, then default pushurl is the same as default pullurl)
git remote set-url --push ${MSC_GIT_REMOTE_NAME:-$MSC_GIT_REMOTE_NAME_DEFAULT} \
${MSC_GIT_PUSHURL:-${MSC_GIT_PULLURL:-${MSC_GIT_PUSHURL_DEFAULT:-$MSC_GIT_PULLURL_DEFAULT}}}
git branch -u "${MSC_GIT_REMOTE_NAME:-$MSC_GIT_REMOTE_NAME_DEFAULT}"/"${MSC_GIT_BRANCH:-$MSC_GIT_BRANCH_DEFAULT}" git branch -u "${MSC_GIT_REMOTE_NAME:-$MSC_GIT_REMOTE_NAME_DEFAULT}"/"${MSC_GIT_BRANCH:-$MSC_GIT_BRANCH_DEFAULT}"
git checkout ${MSC_GIT_BRANCH:-$MSC_GIT_BRANCH_DEFAULT} git checkout ${MSC_GIT_BRANCH:-$MSC_GIT_BRANCH_DEFAULT}
loginfo "now remotes are: $(git remote -v)" loginfo "now remotes are: $(git remote -v)"