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-2.eclass 1/2] Clean up non-bare checkout before updating.
Date: Fri, 23 Dec 2011 14:35:11
Message-Id: 1324650896-1286-1-git-send-email-mgorny@gentoo.org
1 Fixes: https://bugs.gentoo.org/show_bug.cgi?id=395247
2 ---
3 eclass/git-2.eclass | 2 ++
4 1 files changed, 2 insertions(+), 0 deletions(-)
5
6 diff --git a/eclass/git-2.eclass b/eclass/git-2.eclass
7 index f1ed79f..4f0b65b 100644
8 --- a/eclass/git-2.eclass
9 +++ b/eclass/git-2.eclass
10 @@ -344,6 +344,8 @@ git-2_update_repo() {
11 if [[ ${EGIT_LOCAL_NONBARE} ]]; then
12 # checkout master branch and drop all other local branches
13 git checkout ${EGIT_MASTER} || die "${FUNCNAME}: can't checkout master branch ${EGIT_MASTER}"
14 + git clean -d -f -x || die "${FUNCNAME}: failed to clean checkout dir"
15 +
16 for x in $(git branch | grep -v "* ${EGIT_MASTER}" | tr '\n' ' '); do
17 debug-print "${FUNCNAME}: git branch -D ${x}"
18 git branch -D ${x} > /dev/null
19 --
20 1.7.8.352.g876a6f.dirty

Replies