From: Petr Baudis Date: Mon, 16 Oct 2006 00:59:25 +0000 (+0200) Subject: bisect reset: Leave the tree in usable state if git-checkout failed X-Git-Tag: v1.4.4-rc1~89^2 X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=commitdiff_plain;h=9b709e47ae46079efe1d7858580dcf5b8cf6ea33;p=git.git bisect reset: Leave the tree in usable state if git-checkout failed I had local modifications in the tree and doing bisect reset required me to manually edit .git/HEAD. Signed-off-by: Petr Baudis Signed-off-by: Junio C Hamano --- diff --git a/git-bisect.sh b/git-bisect.sh index 06a8d2694..6da31e87a 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 () {