Skip to content

Commit

Permalink
bisect reset: Leave the tree in usable state if git-checkout failed
Browse files Browse the repository at this point in the history
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>
Signed-off-by: Junio C Hamano <junkio@cox.net>
  • Loading branch information
Petr Baudis authored and Junio C Hamano committed Oct 17, 2006
1 parent 3453f86 commit 9b709e4
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions git-bisect.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 () {
Expand Down

0 comments on commit 9b709e4

Please sign in to comment.