From 9e38ad819a925b78d323233ce54be562c2c3fa0c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Wed, 10 Jun 2020 20:05:37 +0200 Subject: [PATCH] Continued: - UNWANTED_REMOTE2 will not be removed MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Roland Häder --- fix-project-remotes.sh | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/fix-project-remotes.sh b/fix-project-remotes.sh index e8b6ec3..b51bd97 100755 --- a/fix-project-remotes.sh +++ b/fix-project-remotes.sh @@ -3,7 +3,7 @@ . ./.jprojects.sh || exit 255 UNWANTED_NAME1="stick" -UNWANTED_NAME2="jtrainings" +UNWANTED_NAME2="jjobboards" WANTED_NAME1="upstream" WANTED_NAME2="daedalus" WANTED_NAME3="transport" @@ -227,19 +227,9 @@ for project in ${LIST}; do if [ -n "${UNWANTED_REMOTE}" ] then - echo "$0: Found remote '${UNWANTED_NAME2}' in '${project}'. Renaming '${GIT_ORIGIN}'->'${WANTED_NAME1}' and '${UNWANTED_NAME2}'->'${GIT_ORIGIN}' ..." + echo "$0: Found remote '${UNWANTED_NAME2}' in '${project}'. Removing it..." - UPSTREAM_REMOTE=$(git remote | grep "${WANTED_NAME1}") - echo "$0: UPSTREAM_REMOTE='${UPSTREAM_REMOTE}'" - - if [ -n "${UPSTREAM_REMOTE}" ] - then - echo "$0: Remotes '${UNWANTED_NAME2}' and '${WANTED_NAME1}' exist! Removing '${WANTED_NAME1}' ..." - git remote rm "${WANTED_NAME1}" || exit 255 - fi - - git remote rename "${GIT_ORIGIN}" "${WANTED_NAME1}" || exit 255 - git remote rename "${UNWANTED_NAME2}" "${GIT_ORIGIN}" || exit 255 + git remote remove "${UNWANTED_REMOTE}" || exit 255 else echo "$0: No unwanted '${UNWANTED_NAME2}' remote in '${project}' ..." UPSTREAM_REMOTE1=$(git remote | grep "${WANTED_NAME1}") -- 2.30.2