/[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.27 Revision 1.28
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.27 2014/03/02 11:44:19 mgorny Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/git-r3.eclass,v 1.28 2014/03/02 11:45:41 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.
456 456
457 # use git init+fetch instead of clone since the latter doesn't like 457 # use git init+fetch instead of clone since the latter doesn't like
458 # non-empty directories. 458 # non-empty directories.
459 459
460 git init --quiet || die 460 git init --quiet || die
461 set -- git fetch --update-head-ok "${orig_repo}" \ 461 # setup 'alternates' to avoid copying objects
462 "refs/heads/*:refs/heads/*" \ 462 echo "${orig_repo}/objects" > "${GIT_DIR}"/objects/info/alternates || die
463 "refs/tags/*:refs/tags/*" \ 463 # now copy the refs
464 "refs/notes/*:refs/notes/*" 464 # [htn]* safely catches heads, tags, notes without complaining
465 # on non-existing ones, and omits internal 'git-r3' ref
466 cp -R "${orig_repo}"/refs/[htn]* "${GIT_DIR}"/refs/ || die
465 467
466 echo "${@}" >&2 468 # (no need to copy HEAD, we will set it via checkout)
467 "${@}" || die "git fetch into checkout dir failed"
468 469
469 set -- git checkout --quiet 470 set -- git checkout --quiet
470 if [[ ${remote_ref} ]]; then 471 if [[ ${remote_ref} ]]; then
471 set -- "${@}" "${remote_ref#refs/heads/}" 472 set -- "${@}" "${remote_ref#refs/heads/}"
472 else 473 else

Legend:
Removed from v.1.27  
changed lines
  Added in v.1.28

  ViewVC Help
Powered by ViewVC 1.1.20