Continued: master
authorRoland Häder <roland@mxchange.org>
Wed, 10 Jun 2020 18:05:37 +0000 (20:05 +0200)
committerRoland Häder <roland@mxchange.org>
Wed, 10 Jun 2020 18:05:37 +0000 (20:05 +0200)
- UNWANTED_REMOTE2 will not be removed

Signed-off-by: Roland Häder <roland@mxchange.org>
fix-project-remotes.sh

index e8b6ec3..b51bd97 100755 (executable)
@@ -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}")