/[gentoo-x86]/eclass/git-r3.eclass
Gentoo

Diff of /eclass/git-r3.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.3 Revision 1.4
1# Copyright 1999-2013 Gentoo Foundation 1# Copyright 1999-2013 Gentoo Foundation
2# Distributed under the terms of the GNU General Public License v2 2# Distributed under the terms of the GNU General Public License v2
3# $Header: /var/cvsroot/gentoo-x86/eclass/git-r3.eclass,v 1.3 2013/09/09 16:01:17 mgorny Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/git-r3.eclass,v 1.4 2013/09/13 15:04:36 mgorny Exp $
4 4
5# @ECLASS: git-r3.eclass 5# @ECLASS: git-r3.eclass
6# @MAINTAINER: 6# @MAINTAINER:
7# Michał Górny <mgorny@gentoo.org> 7# Michał Górny <mgorny@gentoo.org>
8# @BLURB: Eclass for fetching and unpacking git repositories. 8# @BLURB: Eclass for fetching and unpacking git repositories.
399 # split on whitespace 399 # split on whitespace
400 local ref=( 400 local ref=(
401 $(git ls-remote "${r}" "${lookup_ref}") 401 $(git ls-remote "${r}" "${lookup_ref}")
402 ) 402 )
403 403
404 local nonshallow=${EGIT_NONSHALLOW}
404 local ref_param=() 405 local ref_param=()
405 if [[ ! ${ref[0]} ]]; then 406 if [[ ! ${ref[0]} ]]; then
406 local EGIT_NONSHALLOW=1 407 nonshallow=1
407 fi 408 fi
408 409
409 # 1. if we need a non-shallow clone and we have a shallow one, 410 # 1. if we need a non-shallow clone and we have a shallow one,
410 # we need to unshallow it explicitly. 411 # we need to unshallow it explicitly.
411 # 2. if we want a shallow clone, we just pass '--depth 1' 412 # 2. if we want a shallow clone, we just pass '--depth 1'
416 # first since that usually transfers less data. however, 417 # first since that usually transfers less data. however,
417 # we use git-r3_smart_fetch that can switch into '--depth 1' 418 # we use git-r3_smart_fetch that can switch into '--depth 1'
418 # if that looks beneficial. 419 # if that looks beneficial.
419 420
420 local fetch_command=( git fetch ) 421 local fetch_command=( git fetch )
421 if [[ ${EGIT_NONSHALLOW} ]]; then 422 if [[ ${nonshallow} ]]; then
422 if [[ -f ${GIT_DIR}/shallow ]]; then 423 if [[ -f ${GIT_DIR}/shallow ]]; then
423 ref_param+=( --unshallow ) 424 ref_param+=( --unshallow )
424 fi 425 fi
425 else 426 else
426 # 'git show-ref --heads' returns 1 when there are no branches 427 # 'git show-ref --heads' returns 1 when there are no branches

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

  ViewVC Help
Powered by ViewVC 1.1.20