Git development
 help / color / mirror / Atom feed
* [PATCH] bisect reset: Leave the tree in usable state if git-checkout failed
@ 2006-10-16  0:59 Petr Baudis
  2006-10-16  1:02 ` Petr Baudis
  0 siblings, 1 reply; 2+ messages in thread
From: Petr Baudis @ 2006-10-16  0:59 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

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 () {

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-10-16  1:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-10-16  0:59 [PATCH] bisect reset: Leave the tree in usable state if git-checkout failed Petr Baudis
2006-10-16  1:02 ` Petr Baudis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox