Gentoo Archives: gentoo-dev

From: "Michał Górny" <mgorny@g.o>
To: gentoo-dev@l.g.o
Cc: "Michał Górny" <mgorny@g.o>
Subject: [gentoo-dev] [PATCH git-r3 11/11] Disable shallow clones of local repositories.
Date: Wed, 26 Feb 2014 23:43:26
Message-Id: 1393458157-13942-11-git-send-email-mgorny@gentoo.org
In Reply to: [gentoo-dev] [PATCHES git-r3] Clean up and different clone type support by "Michał Górny"
1 It was already proven before that trying to fetch those with '--depth'
2 result in sandbox violations due to git writing temporary files
3 in the repository. Instead, fetch them as 'single'.
4 ---
5 eclass/git-r3.eclass | 8 ++++++--
6 1 file changed, 6 insertions(+), 2 deletions(-)
7
8 diff --git a/eclass/git-r3.eclass b/eclass/git-r3.eclass
9 index 37138a9..7ab94d2 100644
10 --- a/eclass/git-r3.eclass
11 +++ b/eclass/git-r3.eclass
12 @@ -507,9 +507,13 @@ git-r3_fetch() {
13 fi
14
15 if [[ ${EGIT_CLONE_TYPE} == shallow ]]; then
16 - # use '--depth 1' when fetching a new branch
17 - if [[ ! $(git rev-parse --quiet --verify "${fetch_r}") ]]
18 + if _git-r3_is_local_repo; then
19 + # '--depth 1' causes sandbox violations with local repos
20 + # bug #491260
21 + local EGIT_CLONE_TYPE=single
22 + elif [[ ! $(git rev-parse --quiet --verify "${fetch_r}") ]]
23 then
24 + # use '--depth 1' when fetching a new branch
25 fetch_command+=( --depth 1 )
26 fi
27 else # non-shallow mode
28 --
29 1.9.0