COMMAND="$1 &> /dev/null"
else
COMMAND="$1"
+ msg $COMMAND
fi
REPO=$2
MIRROR_REPO=${MIRROR_GIT}/${GIT_NAME}
MASTER_REPO=${MASTER_GIT}/${GIT_NAME}
- if [ -d ${REPO_DIR} ]
- then
- msg "pulling from ${REPO_NAME}"
- run "git fetch origin --tags" ${REPO_DIR}
- run "git fetch origin" ${REPO_DIR}
- run "git merge --ff origin/master" ${REPO_DIR}
- if [ $? -ne 0 ]
- then
- error "Can not fetch from ${MASTER_REPO}"
- fi
- else
- msg "mirroring in ${REPO_NAME} for the first time"
- run "git clone ${MIRROR_REPO}" ${LOCAL_MIRROR_DIR}
- run "git remote add local_master ${MASTER_REPO}" ${REPO_DIR}
- fi
+# if [ -d ${REPO_DIR} ]
+# then
+# msg "pulling from ${REPO_NAME}"
+# run "git fetch origin --tags" ${REPO_DIR}
+# run "git fetch origin" ${REPO_DIR}
+# run "git merge --ff origin/master" ${REPO_DIR}
+# if [ $? -ne 0 ]
+# then
+# error "Can not fetch from ${MASTER_REPO}"
+# fi
+# else
+# msg "mirroring in ${REPO_NAME} for the first time"
+# run "git clone ${MIRROR_REPO}" ${LOCAL_MIRROR_DIR}
+# run "git remote add local_master ${MASTER_REPO}" ${REPO_DIR}
+# fi
+
+ msg "mirroring in ${REPO_NAME} for the first time"
+ run "rm -rf ${REPO_DIR}" ${LOCAL_MIRROR_DIR}
+ run "git clone ${MIRROR_REPO}" ${LOCAL_MIRROR_DIR}
+ run "git remote add local_master ${MASTER_REPO}" ${REPO_DIR}
msg "pushing ${REPO_NAME} to local master"
run "git fetch local_master --tags" ${REPO_DIR}