Continued:
[jprojects-scripts.git] / fix-project-remotes.sh
index e8b6ec30d8e2174d7b32737bd1a601af21c22ebb..b51bd975b15f76f28c56ee90130d0a6bbe3e6b4f 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}")