From 354ed21889d1d0e6643ac4cb3d548cd0469a1431 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakobus=20Sch=C3=BCrz?= Date: Mon, 23 Jan 2023 08:30:31 +0100 Subject: [PATCH] set pushurl from pullurl when configured --- functions.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/functions.sh b/functions.sh index 52dc9ae..c442e01 100755 --- a/functions.sh +++ b/functions.sh @@ -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 --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 checkout ${MSC_GIT_BRANCH:-$MSC_GIT_BRANCH_DEFAULT} loginfo "now remotes are: $(git remote -v)"