/[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.4 Revision 1.6
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.4 2013/09/13 15:04:36 mgorny Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/git-r3.eclass,v 1.6 2013/09/19 09:37:14 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.
206 addwrite "${EGIT3_STORE_DIR}" 206 addwrite "${EGIT3_STORE_DIR}"
207 if [[ ! -d ${GIT_DIR} ]]; then 207 if [[ ! -d ${GIT_DIR} ]]; then
208 mkdir "${GIT_DIR}" || die 208 mkdir "${GIT_DIR}" || die
209 git init --bare || die 209 git init --bare || die
210 210
211 if [[ ! ${EGIT_NONSHALLOW} ]]; then
211 # avoid auto-unshallow :) 212 # avoid auto-unshallow :)
212 touch "${GIT_DIR}"/shallow || die 213 touch "${GIT_DIR}"/shallow || die
214 fi
213 fi 215 fi
214} 216}
215 217
216# @FUNCTION: _git-r3_set_submodules 218# @FUNCTION: _git-r3_set_submodules
217# @USAGE: <file-contents> 219# @USAGE: <file-contents>
396 # and not a commit id. if it succeeds, we can pass ${remote_ref} 398 # and not a commit id. if it succeeds, we can pass ${remote_ref}
397 # to 'fetch'. otherwise, we will just fetch everything 399 # to 'fetch'. otherwise, we will just fetch everything
398 400
399 # split on whitespace 401 # split on whitespace
400 local ref=( 402 local ref=(
401 $(git ls-remote "${r}" "${lookup_ref}") 403 $(git ls-remote "${r}" "${lookup_ref}" || echo __FAIL__)
402 ) 404 )
405
406 # normally, ref[0] is a hash, so we can do magic strings here
407 [[ ${ref[0]} == __FAIL__ ]] && continue
403 408
404 local nonshallow=${EGIT_NONSHALLOW} 409 local nonshallow=${EGIT_NONSHALLOW}
405 local ref_param=() 410 local ref_param=()
406 if [[ ! ${ref[0]} ]]; then 411 if [[ ! ${ref[0]} ]]; then
407 nonshallow=1 412 nonshallow=1

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

  ViewVC Help
Powered by ViewVC 1.1.20