File tree Expand file tree Collapse file tree 1 file changed +14
-3
lines changed
Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -49,9 +49,16 @@ bisect_start() {
4949 die " Bad HEAD - I need a symbolic ref"
5050 case " $head " in
5151 refs/heads/bisect* )
52- git checkout master || exit
52+ if [ -s " $GIT_DIR /head-name" ]; then
53+ branch=` cat " $GIT_DIR /head-name" `
54+ else
55+ branch=master
56+ fi
57+ git checkout $branch || exit
5358 ;;
5459 refs/heads/* )
60+ [ -s " $GIT_DIR /head-name" ] && die " won't bisect on seeked tree"
61+ echo " $head " | sed ' s#^refs/heads/##' > " $GIT_DIR /head-name"
5562 ;;
5663 * )
5764 die " Bad HEAD - strange symbolic ref"
@@ -159,7 +166,11 @@ bisect_visualize() {
159166
160167bisect_reset () {
161168 case " $# " in
162- 0) branch=master ;;
169+ 0) if [ -s " $GIT_DIR /head-name" ]; then
170+ branch=` cat " $GIT_DIR /head-name" `
171+ else
172+ branch=master
173+ fi ;;
163174 1) test -f " $GIT_DIR /refs/heads/$1 " || {
164175 echo >&2 " $1 does not seem to be a valid branch"
165176 exit 1
@@ -170,7 +181,7 @@ bisect_reset() {
170181 esac
171182 git checkout " $branch " &&
172183 rm -fr " $GIT_DIR /refs/bisect"
173- rm -f " $GIT_DIR /refs/heads/bisect"
184+ rm -f " $GIT_DIR /refs/heads/bisect" " $GIT_DIR /head-name "
174185 rm -f " $GIT_DIR /BISECT_LOG"
175186}
176187
You can’t perform that action at this time.
0 commit comments