diff options
author | Tomas Chvatal <scarabeus@gentoo.org> | 2009-03-19 11:51:13 +0000 |
---|---|---|
committer | Tomas Chvatal <scarabeus@gentoo.org> | 2009-03-19 11:51:13 +0000 |
commit | c0b60a4ae66897a81d85c895a9a641ab47cbae6b (patch) | |
tree | a90b178fb6beaa0cb19a7cd9a135f6e2a29ae30c /eclass/git.eclass | |
parent | Version bump; added -j1 to emake asymptote.pdf in an attempt to fix the bug #... (diff) | |
download | historical-c0b60a4ae66897a81d85c895a9a641ab47cbae6b.tar.gz historical-c0b60a4ae66897a81d85c895a9a641ab47cbae6b.tar.bz2 historical-c0b60a4ae66897a81d85c895a9a641ab47cbae6b.zip |
Update --depth 1 behavior for only working cases.
Diffstat (limited to 'eclass/git.eclass')
-rw-r--r-- | eclass/git.eclass | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/eclass/git.eclass b/eclass/git.eclass index fb3035099df0..17d563ecfcbb 100644 --- a/eclass/git.eclass +++ b/eclass/git.eclass @@ -1,6 +1,6 @@ # Copyright 1999-2006 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/git.eclass,v 1.15 2009/02/19 17:07:28 scarabeus Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/git.eclass,v 1.16 2009/03/19 11:51:13 scarabeus Exp $ ## --------------------------------------------------------------------------- # # subversion.eclass author: Akinori Hattori <hattya@gentoo.org> @@ -40,7 +40,7 @@ EGIT_STORE_DIR="${PORTAGE_ACTUAL_DISTDIR-${DISTDIR}}/git-src" ## -- EGIT_FETCH_CMD: git clone command # -EGIT_FETCH_CMD="git clone --bare --depth 1" +EGIT_FETCH_CMD="git clone --bare" ## -- EGIT_UPDATE_CMD: git fetch command # @@ -189,6 +189,12 @@ git_fetch() { [[ -z ${EGIT_REPO_URI##*/} ]] && EGIT_REPO_URI="${EGIT_REPO_URI%/}" EGIT_CLONE_DIR="${EGIT_PROJECT}" + # determine whether to perform shallow clone + local EGIT_FETCH_OPTS + if [[ ${EGIT_BRANCH} = ${EGIT_TREE} ]] && [[ ${EGIT_BRANCH} = master ]] ; then + EGIT_FETCH_OPTS="--depth 1" + fi + debug-print "${FUNCNAME}: EGIT_OPTIONS = \"${EGIT_OPTIONS}\"" export GIT_DIR="${EGIT_STORE_DIR}/${EGIT_CLONE_DIR}" @@ -198,7 +204,7 @@ git_fetch() { einfo "git clone start -->" einfo " repository: ${EGIT_REPO_URI}" - ${EGIT_FETCH_CMD} ${EGIT_OPTIONS} "${EGIT_REPO_URI}" ${EGIT_PROJECT} \ + ${EGIT_FETCH_CMD} ${EGIT_FETCH_OPTS} ${EGIT_OPTIONS} "${EGIT_REPO_URI}" ${EGIT_PROJECT} \ || die "${EGIT}: can't fetch from ${EGIT_REPO_URI}." # We use --bare cloning, so git doesn't do this for us. |