1 |
scarabeus 09/04/07 15:03:32 |
2 |
|
3 |
Modified: git.eclass |
4 |
Log: |
5 |
Add working migration for shallow copy repositories. We cant keep it around showing errors. |
6 |
|
7 |
Revision Changes Path |
8 |
1.21 eclass/git.eclass |
9 |
|
10 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/git.eclass?rev=1.21&view=markup |
11 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/git.eclass?rev=1.21&content-type=text/plain |
12 |
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/git.eclass?r1=1.20&r2=1.21 |
13 |
|
14 |
Index: git.eclass |
15 |
=================================================================== |
16 |
RCS file: /var/cvsroot/gentoo-x86/eclass/git.eclass,v |
17 |
retrieving revision 1.20 |
18 |
retrieving revision 1.21 |
19 |
diff -u -r1.20 -r1.21 |
20 |
--- git.eclass 7 Apr 2009 14:39:32 -0000 1.20 |
21 |
+++ git.eclass 7 Apr 2009 15:03:32 -0000 1.21 |
22 |
@@ -1,6 +1,6 @@ |
23 |
# Copyright 1999-2009 Gentoo Foundation |
24 |
# Distributed under the terms of the GNU General Public License v2 |
25 |
-# $Header: /var/cvsroot/gentoo-x86/eclass/git.eclass,v 1.20 2009/04/07 14:39:32 scarabeus Exp $ |
26 |
+# $Header: /var/cvsroot/gentoo-x86/eclass/git.eclass,v 1.21 2009/04/07 15:03:32 scarabeus Exp $ |
27 |
|
28 |
# @ECLASS: git.eclass |
29 |
# @MAINTAINER: |
30 |
@@ -46,7 +46,7 @@ |
31 |
# @ECLASS-VARIABLE: EGIT_FETCH_CMD |
32 |
# @DESCRIPTION: |
33 |
# Command for cloning the repository. |
34 |
-EGIT_FETCH_CMD="git clone --bare" |
35 |
+: ${EGIT_FETCH_CMD:="git clone --bare"} |
36 |
|
37 |
# @ECLASS-VARIABLE: EGIT_UPDATE_CMD |
38 |
# @DESCRIPTION: |
39 |
@@ -144,7 +144,7 @@ |
40 |
|
41 |
# If we have same branch and the tree we can do --depth 1 clone |
42 |
# which outputs into really smaller data transfers. |
43 |
- # Sadly we can do shallow copy for now because quite few packages need .git |
44 |
+ # Sadly we can do shallow copy for now because quite a few packages need .git |
45 |
# folder. |
46 |
#[[ ${EGIT_TREE} = ${EGIT_BRANCH} ]] && \ |
47 |
# EGIT_FETCH_CMD="${EGIT_FETCH_CMD} --depth 1" |
48 |
@@ -183,6 +183,13 @@ |
49 |
|
50 |
export GIT_DIR="${EGIT_STORE_DIR}/${EGIT_CLONE_DIR}" |
51 |
|
52 |
+ # we also have to remove all shallow copied repositories |
53 |
+ # and fetch them again |
54 |
+ if [[ -e "${EGIT_STORE_DIR}/${EGIT_CLONE_DIR}/shallow" ]]; then |
55 |
+ rm -rf "${EGIT_STORE_DIR}/${EGIT_CLONE_DIR}" |
56 |
+ einfo "The ${EGIT_CLONE_DIR} was shallow copy. Refetching." |
57 |
+ fi |
58 |
+ |
59 |
if [[ ! -d ${EGIT_CLONE_DIR} ]] ; then |
60 |
# first clone |
61 |
${elogcmd} "GIT NEW clone -->" |
62 |
@@ -223,7 +230,6 @@ |
63 |
else |
64 |
${elogcmd} " at the commit: ${cursha1}" |
65 |
fi |
66 |
- # piping through cat is needed to avoid a stupid Git feature |
67 |
${EGIT_DIFFSTAT_CMD} ${oldsha1}..${EGIT_BRANCH} |
68 |
fi |