X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=git-bisect.sh;h=06a8d26945a679b06438308ceb96c69cd76c43db;hb=5a990e45f920b50aa6b81823120223fb50f56d97;hp=51e1e4417d95530612d3ce5db64c8295c9236f53;hpb=1ed91937e5cd59fdbdfa5f15f6fac132d2b21ce0;p=git.git diff --git a/git-bisect.sh b/git-bisect.sh index 51e1e4417..06a8d2694 100755 --- a/git-bisect.sh +++ b/git-bisect.sh @@ -13,7 +13,7 @@ git bisect log show bisect log.' . git-sh-setup sq() { - perl -e ' + @@PERL@@ -e ' for (@ARGV) { s/'\''/'\'\\\\\'\''/g; print " '\''$_'\''"; @@ -49,9 +49,16 @@ bisect_start() { die "Bad HEAD - I need a symbolic ref" case "$head" in refs/heads/bisect*) - git checkout master || exit + if [ -s "$GIT_DIR/head-name" ]; then + branch=`cat "$GIT_DIR/head-name"` + else + branch=master + fi + git checkout $branch || exit ;; refs/heads/*) + [ -s "$GIT_DIR/head-name" ] && die "won't bisect on seeked tree" + echo "$head" | sed 's#^refs/heads/##' >"$GIT_DIR/head-name" ;; *) die "Bad HEAD - strange symbolic ref" @@ -159,7 +166,11 @@ bisect_visualize() { bisect_reset() { case "$#" in - 0) branch=master ;; + 0) if [ -s "$GIT_DIR/head-name" ]; then + branch=`cat "$GIT_DIR/head-name"` + else + branch=master + fi ;; 1) test -f "$GIT_DIR/refs/heads/$1" || { echo >&2 "$1 does not seem to be a valid branch" exit 1 @@ -170,8 +181,9 @@ bisect_reset() { esac git checkout "$branch" && rm -fr "$GIT_DIR/refs/bisect" - rm -f "$GIT_DIR/refs/heads/bisect" + rm -f "$GIT_DIR/refs/heads/bisect" "$GIT_DIR/head-name" rm -f "$GIT_DIR/BISECT_LOG" + rm -f "$GIT_DIR/BISECT_NAMES" } bisect_replay () {