Git development
 help / color / mirror / Atom feed
From: Petr Baudis <pasky@suse.cz>
To: Junio C Hamano <junkio@cox.net>
Cc: <git@vger.kernel.org>
Subject: [PATCH] bisect reset: Leave the tree in usable state if git-checkout failed
Date: Mon, 16 Oct 2006 02:59:25 +0200	[thread overview]
Message-ID: <20061016005925.27019.38262.stgit@machine.or.cz> (raw)

I had local modifications in the tree and doing bisect reset required me to
manually edit .git/HEAD.

Signed-off-by: Petr Baudis <pasky@suse.cz>
---

 git-bisect.sh |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/git-bisect.sh b/git-bisect.sh
index 06a8d26..09cd179 100755
--- a/git-bisect.sh
+++ b/git-bisect.sh
@@ -179,11 +179,12 @@ bisect_reset() {
         *)
 	    usage ;;
 	esac
-	git checkout "$branch" &&
-	rm -fr "$GIT_DIR/refs/bisect"
-	rm -f "$GIT_DIR/refs/heads/bisect" "$GIT_DIR/head-name"
-	rm -f "$GIT_DIR/BISECT_LOG"
-	rm -f "$GIT_DIR/BISECT_NAMES"
+	if ! git checkout "$branch"; then
+		rm -fr "$GIT_DIR/refs/bisect"
+		rm -f "$GIT_DIR/refs/heads/bisect" "$GIT_DIR/head-name"
+		rm -f "$GIT_DIR/BISECT_LOG"
+		rm -f "$GIT_DIR/BISECT_NAMES"
+	fi
 }
 
 bisect_replay () {

             reply	other threads:[~2006-10-16  0:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-16  0:59 Petr Baudis [this message]
2006-10-16  1:02 ` [PATCH] bisect reset: Leave the tree in usable state if git-checkout failed Petr Baudis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20061016005925.27019.38262.stgit@machine.or.cz \
    --to=pasky@suse.cz \
    --cc=git@vger.kernel.org \
    --cc=junkio@cox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox