Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 269491 | Differences between
and this patch

Collapse All | Expand All

(-)git.eclass (-9 / +18 lines)
Lines 145-151 Link Here
145
# @FUNCTION: git_submodules
145
# @FUNCTION: git_submodules
146
# @DESCRIPTION:
146
# @DESCRIPTION:
147
# Internal function wrapping the submodule initialisation and update
147
# Internal function wrapping the submodule initialisation and update
148
git_sumbodules() {
148
git_submodules() {
149
	debug-print "git submodule init"
149
	debug-print "git submodule init"
150
	git submodule init
150
	git submodule init
151
	debug-print "git submodule update"
151
	debug-print "git submodule update"
Lines 228-234 Link Here
228
	debug-print "${FUNCNAME}: EGIT_OPTIONS = \"${EGIT_OPTIONS}\""
228
	debug-print "${FUNCNAME}: EGIT_OPTIONS = \"${EGIT_OPTIONS}\""
229
229
230
	GIT_DIR="${EGIT_STORE_DIR}/${EGIT_CLONE_DIR}"
230
	GIT_DIR="${EGIT_STORE_DIR}/${EGIT_CLONE_DIR}"
231
	pushd ${EGIT_STORE_DIR} &> /dev/null
232
	# we also have to remove all shallow copied repositories
231
	# we also have to remove all shallow copied repositories
233
	# and fetch them again
232
	# and fetch them again
234
	if [[ -e "${GIT_DIR}/shallow" ]]; then
233
	if [[ -e "${GIT_DIR}/shallow" ]]; then
Lines 254-261 Link Here
254
		cursha1=$(git rev-parse origin/${EGIT_BRANCH})
253
		cursha1=$(git rev-parse origin/${EGIT_BRANCH})
255
		${elogcmd} "   at the commit:		${cursha1}"
254
		${elogcmd} "   at the commit:		${cursha1}"
256
255
257
		git_branch
256
		git_submodules
258
		git_sumbodules
259
		popd &> /dev/null
257
		popd &> /dev/null
260
	elif [[ -n ${EGIT_OFFLINE} ]] ; then
258
	elif [[ -n ${EGIT_OFFLINE} ]] ; then
261
		pushd "${GIT_DIR}" &> /dev/null
259
		pushd "${GIT_DIR}" &> /dev/null
Lines 276-286 Link Here
276
		oldsha1=$(git rev-parse origin/${EGIT_BRANCH})
274
		oldsha1=$(git rev-parse origin/${EGIT_BRANCH})
277
275
278
		debug-print "${EGIT_UPDATE_CMD} ${EGIT_OPTIONS}"
276
		debug-print "${EGIT_UPDATE_CMD} ${EGIT_OPTIONS}"
277
		# fix branching
278
		git checkout master
279
		for x in $(git branch |grep -v "* master" |tr '\n' ' '); do
280
			git branch -D ${x}
281
		done
279
		${EGIT_UPDATE_CMD} ${EGIT_OPTIONS} \
282
		${EGIT_UPDATE_CMD} ${EGIT_OPTIONS} \
280
			|| die "${EGIT}: can't update from ${EGIT_REPO_URI}."
283
			|| die "${EGIT}: can't update from ${EGIT_REPO_URI}."
281
284
282
		git_branch
285
		git_submodules
283
		git_sumbodules
284
		cursha1=$(git rev-parse origin/${EGIT_BRANCH})
286
		cursha1=$(git rev-parse origin/${EGIT_BRANCH})
285
287
286
		# write out message based on the revisions
288
		# write out message based on the revisions
Lines 315-328 Link Here
315
	# export the git version
317
	# export the git version
316
	export EGIT_VERSION="${cursha1}"
318
	export EGIT_VERSION="${cursha1}"
317
319
320
	# log the repo state
318
	[[ ${EGIT_COMMIT} != ${EGIT_BRANCH} ]] && elog "   commit:			${EGIT_COMMIT}"
321
	[[ ${EGIT_COMMIT} != ${EGIT_BRANCH} ]] && elog "   commit:			${EGIT_COMMIT}"
319
	${elogcmd} "   branch: 			${EGIT_BRANCH}"
322
	${elogcmd} "   branch: 			${EGIT_BRANCH}"
320
	${elogcmd} "   storage directory: 	\"${GIT_DIR}\""
323
	${elogcmd} "   storage directory: 	\"${GIT_DIR}\""
321
324
322
	# unpack to the ${S}
325
	pushd "${GIT_DIR}" &> /dev/null
326
	debug-print "rsync -rlpgo . \"${S}\""
327
	time rsync -rlpgo . "${S}"
328
	popd &> /dev/null
329
330
	pushd "${S}" &> /dev/null
331
	git_branch
332
	# submodules always reqire net (thanks to branches changing)
333
	[[ -n ${EGIT_OFFLINE} ]] || git_submodules
323
	popd &> /dev/null
334
	popd &> /dev/null
324
	debug-print "git clone -l -s \"${GIT_DIR}\" \"${S}\""
325
	git clone -l -s "${GIT_DIR}" "${S}"
326
335
327
	echo ">>> Unpacked to ${S}"
336
	echo ">>> Unpacked to ${S}"
328
}
337
}

Return to bug 269491