--- git.eclass.orig 2010-02-24 13:08:52.000000000 +0100 +++ git.eclass 2010-02-24 13:05:55.000000000 +0100 @@ -247,12 +247,6 @@ git_fetch() { debug-print "${FUNCNAME}: EGIT_OPTIONS = \"${EGIT_OPTIONS}\"" GIT_DIR="${EGIT_STORE_DIR}/${EGIT_CLONE_DIR}" - # we also have to remove all shallow copied repositories - # and fetch them again - if [[ -e "${GIT_DIR}/shallow" ]]; then - rm -rf "${GIT_DIR}" - einfo "The ${EGIT_CLONE_DIR} was shallow copy. Refetching." - fi # repack from bare copy to normal one if ${EGIT_HAS_SUBMODULES} && [[ -d ${GIT_DIR} && ! -d "${GIT_DIR}/.git/" ]]; then rm -rf "${GIT_DIR}" @@ -358,18 +352,24 @@ git_fetch() { ${elogcmd} " branch: ${EGIT_BRANCH}" ${elogcmd} " storage directory: \"${GIT_DIR}\"" + pushd "${GIT_DIR}" &> /dev/null if ${EGIT_HAS_SUBMODULES}; then - pushd "${GIT_DIR}" &> /dev/null debug-print "rsync -rlpgo . \"${S}\"" time rsync -rlpgo . "${S}" - popd &> /dev/null else - unset GIT_DIR - debug-print "git clone -l -s -n \"${EGIT_STORE_DIR}/${EGIT_CLONE_DIR}\" \"${S}\"" - git clone -l -s -n "${EGIT_STORE_DIR}/${EGIT_CLONE_DIR}" "${S}" + mkdir "${S}" + debug-print "rsync -rlpgo . \"${S}/.git\"" + time rsync -rlpgo . "${S}/.git" fi + unset GIT_DIR + popd &> /dev/null pushd "${S}" &> /dev/null + if ! ${EGIT_HAS_SUBMODULES}; then + # need to reinit the repo and check it out + git init || die + git checkout || die + fi git_branch # submodules always reqire net (thanks to branches changing) [[ -n ${EGIT_OFFLINE} ]] || git_submodules