| 1 | # Copyright 1999-2009 Gentoo Foundation |
1 | # Copyright 1999-2009 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.eclass,v 1.18 2009/04/06 00:00:47 robbat2 Exp $ |
3 | # $Header: /var/cvsroot/gentoo-x86/eclass/git.eclass,v 1.35 2010/01/13 20:04:19 scarabeus Exp $ |
| 4 | |
4 | |
| 5 | # @ECLASS: git.eclass |
5 | # @ECLASS: git.eclass |
| 6 | # @MAINTAINER: |
6 | # @MAINTAINER: |
| 7 | # Tomas Chvatal <scarabeus@gentoo.org> |
7 | # Tomas Chvatal <scarabeus@gentoo.org> |
| 8 | # Donnie Berkholz <dberkholz@gentoo.org> |
8 | # Donnie Berkholz <dberkholz@gentoo.org> |
| 9 | # @BLURB: This eclass provides functions for fetch and unpack git repozitories |
9 | # @BLURB: This eclass provides functions for fetch and unpack git repositories |
| 10 | # @DESCRIPTION: |
10 | # @DESCRIPTION: |
| 11 | # The eclass is based on subversion eclass. |
11 | # The eclass is based on subversion eclass. |
| 12 | # If you use this eclass, the ${S} is ${WORKDIR}/${P}. |
12 | # If you use this eclass, the ${S} is ${WORKDIR}/${P}. |
| 13 | # It is necessary to define the EGIT_REPO_URI variable at least. |
13 | # It is necessary to define the EGIT_REPO_URI variable at least. |
| 14 | # @THANKS TO: |
14 | # @THANKS TO: |
| … | |
… | |
| 18 | |
18 | |
| 19 | EGIT="git.eclass" |
19 | EGIT="git.eclass" |
| 20 | |
20 | |
| 21 | EXPORTED_FUNCTIONS="src_unpack" |
21 | EXPORTED_FUNCTIONS="src_unpack" |
| 22 | case "${EAPI:-0}" in |
22 | case "${EAPI:-0}" in |
| 23 | 2) EXPORT_FUNCTIONS="${EXPORTED_FUNCTIONS} src_prepare" ;; |
23 | 2) EXPORTED_FUNCTIONS="${EXPORTED_FUNCTIONS} src_prepare" ;; |
| 24 | 0|1) ;; |
24 | 0|1) ;; |
| 25 | *) die "Unknown EAPI, Bug eclass maintainers." ;; |
25 | *) die "Unknown EAPI, Bug eclass maintainers." ;; |
| 26 | esac |
26 | esac |
| 27 | EXPORT_FUNCTIONS ${EXPORTED_FUNCTIONS} |
27 | EXPORT_FUNCTIONS ${EXPORTED_FUNCTIONS} |
| 28 | |
28 | |
| … | |
… | |
| 39 | : ${EGIT_QUIET:="OFF"} |
39 | : ${EGIT_QUIET:="OFF"} |
| 40 | |
40 | |
| 41 | # @ECLASS-VARIABLE: EGIT_STORE_DIR |
41 | # @ECLASS-VARIABLE: EGIT_STORE_DIR |
| 42 | # @DESCRIPTION: |
42 | # @DESCRIPTION: |
| 43 | # Storage directory for git sources. |
43 | # Storage directory for git sources. |
|
|
44 | # Can be redefined. |
| 44 | EGIT_STORE_DIR="${PORTAGE_ACTUAL_DISTDIR-${DISTDIR}}/git-src" |
45 | [[ -z ${EGIT_STORE_DIR} ]] && EGIT_STORE_DIR="${PORTAGE_ACTUAL_DISTDIR-${DISTDIR}}/git-src" |
| 45 | |
46 | |
| 46 | # @ECLASS-VARIABLE: EGIT_FETCH_CMD |
47 | # @ECLASS-VARIABLE: EGIT_FETCH_CMD |
| 47 | # @DESCRIPTION: |
48 | # @DESCRIPTION: |
| 48 | # Command for cloning the repository. |
49 | # Command for cloning the repository. |
| 49 | EGIT_FETCH_CMD="git clone --bare" |
50 | : ${EGIT_FETCH_CMD:="git clone"} |
| 50 | |
51 | |
| 51 | # @ECLASS-VARIABLE: EGIT_UPDATE_CMD |
52 | # @ECLASS-VARIABLE: EGIT_UPDATE_CMD |
| 52 | # @DESCRIPTION: |
53 | # @DESCRIPTION: |
| 53 | # Git fetch command. |
54 | # Git fetch command. |
| 54 | EGIT_UPDATE_CMD="git fetch -f -u" |
55 | EGIT_UPDATE_CMD="git pull -f -u" |
| 55 | |
56 | |
| 56 | # @ECLASS-VARIABLE: EGIT_DIFFSTAT_CMD |
57 | # @ECLASS-VARIABLE: EGIT_DIFFSTAT_CMD |
| 57 | # @DESCRIPTION: |
58 | # @DESCRIPTION: |
| 58 | # Git command for diffstat. |
59 | # Git command for diffstat. |
| 59 | EGIT_DIFFSTAT_CMD="git --no-pager diff --stat" |
60 | EGIT_DIFFSTAT_CMD="git --no-pager diff --stat" |
| … | |
… | |
| 72 | # https:// |
73 | # https:// |
| 73 | # git:// |
74 | # git:// |
| 74 | # git+ssh:// |
75 | # git+ssh:// |
| 75 | # rsync:// |
76 | # rsync:// |
| 76 | # ssh:// |
77 | # ssh:// |
| 77 | : ${EGIT_REPO_URI:=} |
78 | eval X="\$${PN//[-+]/_}_LIVE_REPO" |
| 78 | |
79 | if [[ ${X} = "" ]]; then |
|
|
80 | EGIT_REPO_URI=${EGIT_REPO_URI:=} |
|
|
81 | else |
|
|
82 | EGIT_REPO_URI="${X}" |
|
|
83 | fi |
| 79 | # @ECLASS-VARIABLE: EGIT_PROJECT |
84 | # @ECLASS-VARIABLE: EGIT_PROJECT |
| 80 | # @DESCRIPTION: |
85 | # @DESCRIPTION: |
| 81 | # Project name of your ebuild. |
86 | # Project name of your ebuild. |
| 82 | # Git eclass will check out the git repository like: |
87 | # Git eclass will check out the git repository like: |
| 83 | # ${EGIT_STORE_DIR}/${EGIT_PROJECT}/${EGIT_REPO_URI##*/} |
88 | # ${EGIT_STORE_DIR}/${EGIT_PROJECT}/${EGIT_REPO_URI##*/} |
| … | |
… | |
| 85 | # http://git.collab.net/repo/git. and PN is subversion-git. |
90 | # http://git.collab.net/repo/git. and PN is subversion-git. |
| 86 | # it will check out like: |
91 | # it will check out like: |
| 87 | # ${EGIT_STORE_DIR}/subversion |
92 | # ${EGIT_STORE_DIR}/subversion |
| 88 | : ${EGIT_PROJECT:=${PN/-git}} |
93 | : ${EGIT_PROJECT:=${PN/-git}} |
| 89 | |
94 | |
| 90 | # @ECLASS-VARIABLE: EGIT_BOOSTRAP |
95 | # @ECLASS-VARIABLE: EGIT_BOOTSTRAP |
| 91 | # @DESCRIPTION: |
96 | # @DESCRIPTION: |
| 92 | # bootstrap script or command like autogen.sh or etc... |
97 | # bootstrap script or command like autogen.sh or etc... |
| 93 | : ${EGIT_BOOTSTRAP:=} |
98 | : ${EGIT_BOOTSTRAP:=} |
| 94 | |
99 | |
| 95 | # @ECLASS-VARIABLE: EGIT_OFFLINE |
100 | # @ECLASS-VARIABLE: EGIT_OFFLINE |
| … | |
… | |
| 106 | # Please take note that this variable should be bash array. |
111 | # Please take note that this variable should be bash array. |
| 107 | |
112 | |
| 108 | # @ECLASS-VARIABLE: EGIT_BRANCH |
113 | # @ECLASS-VARIABLE: EGIT_BRANCH |
| 109 | # @DESCRIPTION: |
114 | # @DESCRIPTION: |
| 110 | # git eclass can fetch any branch in git_fetch(). |
115 | # git eclass can fetch any branch in git_fetch(). |
| 111 | : ${EGIT_BRANCH:=master} |
116 | eval X="\$${PN//[-+]/_}_LIVE_BRANCH" |
|
|
117 | if [[ ${X} = "" ]]; then |
|
|
118 | EGIT_BRANCH=${EGIT_BRANCH:=master} |
|
|
119 | else |
|
|
120 | EGIT_BRANCH="${X}" |
|
|
121 | fi |
| 112 | |
122 | |
| 113 | # @ECLASS-VARIABLE: EGIT_TREE |
123 | # @ECLASS-VARIABLE: EGIT_COMMIT |
| 114 | # @DESCRIPTION: |
124 | # @DESCRIPTION: |
| 115 | # git eclass can checkout any tree. |
125 | # git eclass can checkout any commit. |
|
|
126 | eval X="\$${PN//[-+]/_}_LIVE_COMMIT" |
|
|
127 | if [[ ${X} = "" ]]; then |
| 116 | : ${EGIT_TREE:=${EGIT_BRANCH}} |
128 | : ${EGIT_COMMIT:=${EGIT_BRANCH}} |
|
|
129 | else |
|
|
130 | EGIT_COMMIT="${X}" |
|
|
131 | fi |
| 117 | |
132 | |
| 118 | # @ECLASS-VARIABLE: EGIT_REPACK |
133 | # @ECLASS-VARIABLE: EGIT_REPACK |
| 119 | # @DESCRIPTION: |
134 | # @DESCRIPTION: |
| 120 | # git eclass will repack objects to save disk space. However this can take a |
135 | # git eclass will repack objects to save disk space. However this can take a |
| 121 | # long time with VERY big repositories. |
136 | # long time with VERY big repositories. |
| 122 | : ${EGIT_REPACK:=false} |
137 | : ${EGIT_REPACK:=false} |
| 123 | |
138 | |
| 124 | # @ECLASS-VARIABLE: EGIT_PRUNE |
139 | # @ECLASS-VARIABLE: EGIT_PRUNE |
| 125 | # @DESCRIPTION: |
140 | # @DESCRIPTION: |
| 126 | # git.eclass can prune the local clone. This is useful if upstream rewinds and |
141 | # git eclass can prune the local clone. This is useful if upstream rewinds and |
| 127 | # rebases branches too often. |
142 | # rebases branches too often. |
| 128 | : ${EGIT_PRUNE:=false} |
143 | : ${EGIT_PRUNE:=false} |
|
|
144 | |
|
|
145 | # @FUNCTION: git_submodules |
|
|
146 | # @DESCRIPTION: |
|
|
147 | # Internal function wrapping the submodule initialisation and update |
|
|
148 | git_sumbodules() { |
|
|
149 | debug-print "git submodule init" |
|
|
150 | git submodule init |
|
|
151 | debug-print "git submodule update" |
|
|
152 | git submodule update |
|
|
153 | } |
| 129 | |
154 | |
| 130 | # @FUNCTION: git_fetch |
155 | # @FUNCTION: git_fetch |
| 131 | # @DESCRIPTION: |
156 | # @DESCRIPTION: |
| 132 | # Gets repository from EGIT_REPO_URI and store it in specified EGIT_STORE_DIR |
157 | # Gets repository from EGIT_REPO_URI and store it in specified EGIT_STORE_DIR |
| 133 | git_fetch() { |
158 | git_fetch() { |
| 134 | debug-print-function ${FUNCNAME} "$@" |
159 | debug-print-function ${FUNCNAME} "$@" |
| 135 | |
160 | |
| 136 | local EGIT_CLONE_DIR oldsha1 cursha1 |
161 | local GIT_DIR EGIT_CLONE_DIR oldsha1 cursha1 |
| 137 | |
162 | |
| 138 | # choose if user wants elog or just einfo. |
163 | # choose if user wants elog or just einfo. |
| 139 | if [[ ${EGIT_QUIET} != OFF ]]; then |
164 | if [[ ${EGIT_QUIET} != OFF ]]; then |
| 140 | elogcmd="einfo" |
165 | elogcmd="einfo" |
| 141 | else |
166 | else |
| 142 | elogcmd="elog" |
167 | elogcmd="elog" |
| 143 | fi |
168 | fi |
| 144 | |
169 | |
| 145 | # If we have same branch and the tree we can do --depth 1 clone |
170 | # If we have same branch and the tree we can do --depth 1 clone |
| 146 | # which outputs into really smaller data transfers. |
171 | # which outputs into really smaller data transfers. |
| 147 | # Sadly we can do shallow copy for now because quite few packages need .git |
172 | # Sadly we can do shallow copy for now because quite a few packages need .git |
| 148 | # folder. |
173 | # folder. |
| 149 | #[[ ${EGIT_TREE} = ${EGIT_BRANCH} ]] && \ |
174 | #[[ ${EGIT_COMMIT} = ${EGIT_BRANCH} ]] && \ |
| 150 | # EGIT_FETCH_CMD="${EGIT_FETCH_CMD} --depth 1" |
175 | # EGIT_FETCH_CMD="${EGIT_FETCH_CMD} --depth 1" |
|
|
176 | if [[ ! -z ${EGIT_TREE} ]] ; then |
|
|
177 | EGIT_COMMIT=${EGIT_TREE} |
|
|
178 | eqawarn "Usage of deprecated EGIT_TREE variable detected." |
|
|
179 | eqawarn "Use EGIT_COMMIT variable instead." |
|
|
180 | fi |
| 151 | |
181 | |
| 152 | # EGIT_REPO_URI is empty. |
182 | # EGIT_REPO_URI is empty. |
| 153 | [[ -z ${EGIT_REPO_URI} ]] && die "${EGIT}: EGIT_REPO_URI is empty." |
183 | [[ -z ${EGIT_REPO_URI} ]] && die "${EGIT}: EGIT_REPO_URI is empty." |
| 154 | |
184 | |
| 155 | # check for the protocol or pull from a local repo. |
185 | # check for the protocol or pull from a local repo. |
| … | |
… | |
| 179 | [[ -z ${EGIT_REPO_URI##*/} ]] && EGIT_REPO_URI="${EGIT_REPO_URI%/}" |
209 | [[ -z ${EGIT_REPO_URI##*/} ]] && EGIT_REPO_URI="${EGIT_REPO_URI%/}" |
| 180 | EGIT_CLONE_DIR="${EGIT_PROJECT}" |
210 | EGIT_CLONE_DIR="${EGIT_PROJECT}" |
| 181 | |
211 | |
| 182 | debug-print "${FUNCNAME}: EGIT_OPTIONS = \"${EGIT_OPTIONS}\"" |
212 | debug-print "${FUNCNAME}: EGIT_OPTIONS = \"${EGIT_OPTIONS}\"" |
| 183 | |
213 | |
| 184 | export GIT_DIR="${EGIT_STORE_DIR}/${EGIT_CLONE_DIR}" |
214 | GIT_DIR="${EGIT_STORE_DIR}/${EGIT_CLONE_DIR}" |
|
|
215 | pushd ${EGIT_STORE_DIR} &> /dev/null |
|
|
216 | # we also have to remove all shallow copied repositories |
|
|
217 | # and fetch them again |
|
|
218 | if [[ -e "${GIT_DIR}/shallow" ]]; then |
|
|
219 | rm -rf "${GIT_DIR}" |
|
|
220 | einfo "The ${EGIT_CLONE_DIR} was shallow copy. Refetching." |
|
|
221 | fi |
|
|
222 | # repack from bare copy to normal one |
|
|
223 | if [[ -d ${GIT_DIR} && ! -d "${GIT_DIR}/.git/" ]]; then |
|
|
224 | rm -rf "${GIT_DIR}" |
|
|
225 | einfo "The ${EGIT_CLONE_DIR} was bare copy. Refetching." |
|
|
226 | fi |
| 185 | |
227 | |
| 186 | if [[ ! -d ${EGIT_CLONE_DIR} ]] ; then |
228 | if [[ ! -d ${GIT_DIR} ]] ; then |
| 187 | # first clone |
229 | # first clone |
| 188 | ${elogcmd} "GIT NEW clone -->" |
230 | ${elogcmd} "GIT NEW clone -->" |
| 189 | ${elogcmd} " repository: ${EGIT_REPO_URI}" |
231 | ${elogcmd} " repository: ${EGIT_REPO_URI}" |
| 190 | |
232 | |
|
|
233 | debug-print "${EGIT_FETCH_CMD} ${EGIT_OPTIONS} \"${EGIT_REPO_URI}\" ${GIT_DIR}" |
| 191 | ${EGIT_FETCH_CMD} ${EGIT_OPTIONS} "${EGIT_REPO_URI}" ${EGIT_PROJECT} \ |
234 | ${EGIT_FETCH_CMD} ${EGIT_OPTIONS} "${EGIT_REPO_URI}" ${GIT_DIR} \ |
| 192 | || die "${EGIT}: can't fetch from ${EGIT_REPO_URI}." |
235 | || die "${EGIT}: can't fetch from ${EGIT_REPO_URI}." |
| 193 | |
236 | |
|
|
237 | pushd "${GIT_DIR}" &> /dev/null |
| 194 | oldsha1=$(git rev-parse ${EGIT_BRANCH}) |
238 | cursha1=$(git rev-parse origin/${EGIT_BRANCH}) |
| 195 | ${elogcmd} " at the commit: ${oldsha1}" |
239 | ${elogcmd} " at the commit: ${cursha1}" |
| 196 | |
240 | |
| 197 | # We use --bare cloning, so git doesn't do this for us. |
241 | git_sumbodules |
| 198 | git config remote.origin.url "${EGIT_REPO_URI}" |
242 | popd &> /dev/null |
| 199 | elif [[ -n ${EGIT_OFFLINE} ]] ; then |
243 | elif [[ -n ${EGIT_OFFLINE} ]] ; then |
|
|
244 | pushd "${GIT_DIR}" &> /dev/null |
| 200 | oldsha1=$(git rev-parse ${EGIT_BRANCH}) |
245 | cursha1=$(git rev-parse origin/${EGIT_BRANCH}) |
| 201 | ${elogcmd} "GIT offline update -->" |
246 | ${elogcmd} "GIT offline update -->" |
| 202 | ${elogcmd} " repository: ${EGIT_REPO_URI}" |
247 | ${elogcmd} " repository: ${EGIT_REPO_URI}" |
| 203 | ${elogcmd} " at the commit: ${oldsha1}" |
248 | ${elogcmd} " at the commit: ${cursha1}" |
|
|
249 | popd &> /dev/null |
| 204 | else |
250 | else |
|
|
251 | pushd "${GIT_DIR}" &> /dev/null |
| 205 | # Git urls might change, so unconditionally set it here |
252 | # Git urls might change, so unconditionally set it here |
| 206 | git config remote.origin.url "${EGIT_REPO_URI}" |
253 | git config remote.origin.url "${EGIT_REPO_URI}" |
| 207 | |
254 | |
| 208 | # fetch updates |
255 | # fetch updates |
| 209 | ${elogcmd} "GIT update -->" |
256 | ${elogcmd} "GIT update -->" |
| 210 | ${elogcmd} " repository: ${EGIT_REPO_URI}" |
257 | ${elogcmd} " repository: ${EGIT_REPO_URI}" |
| 211 | |
258 | |
| 212 | oldsha1=$(git rev-parse ${EGIT_BRANCH}) |
259 | oldsha1=$(git rev-parse origin/${EGIT_BRANCH}) |
| 213 | |
260 | |
| 214 | ${EGIT_UPDATE_CMD} ${EGIT_OPTIONS} origin ${EGIT_BRANCH}:${EGIT_BRANCH} \ |
261 | debug-print "${EGIT_UPDATE_CMD} ${EGIT_OPTIONS}" |
|
|
262 | ${EGIT_UPDATE_CMD} ${EGIT_OPTIONS} \ |
| 215 | || die "${EGIT}: can't update from ${EGIT_REPO_URI}." |
263 | || die "${EGIT}: can't update from ${EGIT_REPO_URI}." |
| 216 | |
264 | |
|
|
265 | git_sumbodules |
| 217 | cursha1=$(git rev-parse ${EGIT_BRANCH}) |
266 | cursha1=$(git rev-parse origin/${EGIT_BRANCH}) |
| 218 | |
267 | |
| 219 | # write out message based on the revisions |
268 | # write out message based on the revisions |
| 220 | if [[ ${oldsha1} != ${cursha1} ]]; then |
269 | if [[ ${oldsha1} != ${cursha1} ]]; then |
| 221 | ${elogcmd} " updating from commit: ${oldsha1}" |
270 | ${elogcmd} " updating from commit: ${oldsha1}" |
| 222 | ${elogcmd} " to commit: ${cursha1}" |
271 | ${elogcmd} " to commit: ${cursha1}" |
| 223 | else |
272 | else |
| 224 | ${elogcmd} " at the commit: ${cursha1}" |
273 | ${elogcmd} " at the commit: ${cursha1}" |
|
|
274 | # @ECLASS_VARIABLE: LIVE_FAIL_FETCH_IF_REPO_NOT_UPDATED |
|
|
275 | # @DESCRIPTION: |
|
|
276 | # If this variable is set to TRUE in make.conf or somewhere in |
|
|
277 | # enviroment the package will fail if there is no update, thus in |
|
|
278 | # combination with --keep-going it would lead in not-updating |
|
|
279 | # pakcages that are up-to-date. |
|
|
280 | # TODO: this can lead to issues if more projects/packages use same repo |
|
|
281 | [[ ${LIVE_FAIL_FETCH_IF_REPO_NOT_UPDATED} = true ]] && \ |
|
|
282 | debug-print "${FUNCNAME}: Repository \"${EGIT_REPO_URI}\" is up-to-date. Skipping." && \ |
|
|
283 | die "${EGIT}: Repository \"${EGIT_REPO_URI}\" is up-to-date. Skipping." |
| 225 | fi |
284 | fi |
| 226 | # piping through cat is needed to avoid a stupid Git feature |
|
|
| 227 | ${EGIT_DIFFSTAT_CMD} ${oldsha1}..${EGIT_BRANCH} |
285 | ${EGIT_DIFFSTAT_CMD} ${oldsha1}..origin/${EGIT_BRANCH} |
|
|
286 | popd &> /dev/null |
| 228 | fi |
287 | fi |
| 229 | |
288 | |
|
|
289 | pushd "${GIT_DIR}" &> /dev/null |
| 230 | if ${EGIT_REPACK} || ${EGIT_PRUNE} ; then |
290 | if ${EGIT_REPACK} || ${EGIT_PRUNE} ; then |
| 231 | ebegin "Garbage collecting the repository" |
291 | ebegin "Garbage collecting the repository" |
| 232 | git gc $(${EGIT_PRUNE} && echo '--prune') |
292 | git gc $(${EGIT_PRUNE} && echo '--prune') |
| 233 | eend $? |
293 | eend $? |
| 234 | fi |
294 | fi |
|
|
295 | popd &> /dev/null |
| 235 | |
296 | |
|
|
297 | # export the git version |
|
|
298 | export EGIT_VERSION="${cursha1}" |
|
|
299 | |
| 236 | [[ ${EGIT_TREE} != ${EGIT_BRANCH} ]] && elog " tree: ${EGIT_TREE}" |
300 | [[ ${EGIT_COMMIT} != ${EGIT_BRANCH} ]] && elog " commit: ${EGIT_COMMIT}" |
| 237 | ${elogcmd} " branch: ${EGIT_BRANCH}" |
301 | ${elogcmd} " branch: ${EGIT_BRANCH}" |
| 238 | ${elogcmd} " storage directory: \"${EGIT_STORE_DIR}/${EGIT_CLONE_DIR}\"" |
302 | ${elogcmd} " storage directory: \"${GIT_DIR}\"" |
| 239 | |
303 | |
| 240 | # export to the ${WORKDIR} |
304 | # unpack to the ${S} |
| 241 | mkdir -p "${S}" |
305 | popd &> /dev/null |
|
|
306 | debug-print "git clone -l \"${GIT_DIR}\" \"${S}\"" |
|
|
307 | git clone -l "${GIT_DIR}" "${S}" |
| 242 | |
308 | |
| 243 | # git data are used in some packages for various variables definition. So we |
309 | # set correct branch and the tree ebuild specified |
| 244 | # copy also .git folder. |
|
|
| 245 | pushd "${S}" > /dev/null |
310 | pushd "${S}" > /dev/null |
| 246 | git clone --bare ${EGIT_STORE_DIR}/${EGIT_CLONE_DIR} .git |
311 | local branchname=branch-${EGIT_BRANCH} src=origin/${EGIT_BRANCH} |
|
|
312 | if [[ ${EGIT_COMMIT} != ${EGIT_BRANCH} ]]; then |
|
|
313 | branchname=tree-${EGIT_COMMIT} |
|
|
314 | src=${EGIT_COMMIT} |
|
|
315 | fi |
|
|
316 | debug-print "git checkout -b ${branchname} ${src}" |
|
|
317 | git checkout -b ${branchname} ${src} 2>&1 > /dev/null |
|
|
318 | git_sumbodules |
| 247 | popd > /dev/null |
319 | popd > /dev/null |
| 248 | |
320 | |
| 249 | git archive --format=tar ${EGIT_TREE} | ( cd "${S}" ; tar xf - ) |
321 | unset branchname src |
| 250 | |
322 | |
| 251 | echo ">>> Unpacked to ${S}" |
323 | echo ">>> Unpacked to ${S}" |
| 252 | } |
324 | } |
| 253 | |
325 | |
| 254 | # @FUNCTION: git_bootstrap |
326 | # @FUNCTION: git_bootstrap |