/[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.22 Revision 1.23
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.22 2013/10/30 19:21:12 mgorny Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/git-r3.eclass,v 1.23 2013/11/15 23:03:23 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.
352 fi 352 fi
353 353
354 return ${main_ret} 354 return ${main_ret}
355} 355}
356 356
357# @FUNCTION: _git-r3_is_local_repo
358# @USAGE: <repo-uri>
359# @INTERNAL
360# @DESCRIPTION:
361# Determine whether the given URI specifies a local (on-disk)
362# repository.
363_git-r3_is_local_repo() {
364 debug-print-function ${FUNCNAME} "$@"
365
366 local uri=${1}
367
368 [[ ${uri} == file://* || ${uri} == /* ]]
369}
370
357# @FUNCTION: git-r3_fetch 371# @FUNCTION: git-r3_fetch
358# @USAGE: [<repo-uri> [<remote-ref> [<local-id>]]] 372# @USAGE: [<repo-uri> [<remote-ref> [<local-id>]]]
359# @DESCRIPTION: 373# @DESCRIPTION:
360# Fetch new commits to the local clone of repository. 374# Fetch new commits to the local clone of repository.
361# 375#
437 local nonshallow=${EGIT_NONSHALLOW} 451 local nonshallow=${EGIT_NONSHALLOW}
438 local ref_param=() 452 local ref_param=()
439 if [[ ! ${ref[0]} ]]; then 453 if [[ ! ${ref[0]} ]]; then
440 nonshallow=1 454 nonshallow=1
441 fi 455 fi
456
457 # trying to do a shallow clone of a local repo makes git try to
458 # write to the repo. we don't want that to happen.
459 _git-r3_is_local_repo "${r}" && nonshallow=1
442 460
443 # 1. if we need a non-shallow clone and we have a shallow one, 461 # 1. if we need a non-shallow clone and we have a shallow one,
444 # we need to unshallow it explicitly. 462 # we need to unshallow it explicitly.
445 # 2. if we want a shallow clone, we just pass '--depth 1' 463 # 2. if we want a shallow clone, we just pass '--depth 1'
446 # to the first fetch in the repo. passing '--depth' 464 # to the first fetch in the repo. passing '--depth'

Legend:
Removed from v.1.22  
changed lines
  Added in v.1.23

  ViewVC Help
Powered by ViewVC 1.1.20