/[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.25 Revision 1.26
1# Copyright 1999-2014 Gentoo Foundation 1# Copyright 1999-2014 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.25 2014/02/24 08:43:34 mgorny Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/git-r3.eclass,v 1.26 2014/02/25 13:01:49 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.
442 ) 442 )
443 local new_commit_id=$( 443 local new_commit_id=$(
444 git rev-parse --verify refs/git-r3/"${local_id}"/__main__ 444 git rev-parse --verify refs/git-r3/"${local_id}"/__main__
445 ) 445 )
446 446
447 set -- git clone --quiet --shared --no-checkout "${GIT_DIR}" "${out_dir}"/
448 echo "${@}" >&2
449 "${@}" || die "git clone (for checkout) failed"
450
451 git-r3_sub_checkout() { 447 git-r3_sub_checkout() {
452 local orig_repo=${GIT_DIR} 448 local orig_repo=${GIT_DIR}
453 local -x GIT_DIR=${out_dir}/.git 449 local -x GIT_DIR=${out_dir}/.git
454 local -x GIT_WORK_TREE=${out_dir} 450 local -x GIT_WORK_TREE=${out_dir}
455 451
456 # pull notes 452 mkdir -p "${out_dir}" || die
457 git fetch "${orig_repo}" "refs/notes/*:refs/notes/*" || die 453
454 # use git init+fetch instead of clone since the latter doesn't like
455 # non-empty directories.
456
457 git init --quiet || die
458 set -- git fetch --update-head-ok "${orig_repo}" \
459 "refs/heads/*:refs/heads/*" \
460 "refs/tags/*:refs/tags/*" \
461 "refs/notes/*:refs/notes/*"
462
463 echo "${@}" >&2
464 "${@}" || die "git fetch into checkout dir failed"
458 465
459 set -- git checkout --quiet 466 set -- git checkout --quiet
460 if [[ ${remote_ref} ]]; then 467 if [[ ${remote_ref} ]]; then
461 set -- "${@}" "${remote_ref#refs/heads/}" 468 set -- "${@}" "${remote_ref#refs/heads/}"
462 else 469 else

Legend:
Removed from v.1.25  
changed lines
  Added in v.1.26

  ViewVC Help
Powered by ViewVC 1.1.20