From: Roland Häder Date: Wed, 10 Jun 2020 18:05:37 +0000 (+0200) Subject: Continued: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=9e38ad819a925b78d323233ce54be562c2c3fa0c;p=jprojects-scripts.git Continued: - UNWANTED_REMOTE2 will not be removed Signed-off-by: Roland Häder --- 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}")