X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=git-bisect.sh;h=2c32d0b9ebcdb9bf43124721e109cfac72149990;hb=b85997d14d1873a4baa3d04966cd5947e6134acd;hp=6594a62919adcf2d1c524cc24435b6fe444f9d52;hpb=67cdec1e58f1f9bc17d500b04e856042e0b2bf59;p=git.git diff --git a/git-bisect.sh b/git-bisect.sh index 6594a6291..2c32d0b9e 100755 --- a/git-bisect.sh +++ b/git-bisect.sh @@ -67,16 +67,18 @@ bisect_start() { die "Bad HEAD - I need a HEAD" case "$head" in refs/heads/bisect) - if [ -s "$GIT_DIR/head-name" ]; then - branch=`cat "$GIT_DIR/head-name"` + if [ -s "$GIT_DIR/BISECT_START" ]; then + branch=`cat "$GIT_DIR/BISECT_START"` else branch=master fi git checkout $branch || exit ;; refs/heads/*|$_x40) + # This error message should only be triggered by cogito usage, + # and cogito users should understand it relates to cg-seek. [ -s "$GIT_DIR/head-name" ] && die "won't bisect on seeked tree" - echo "${head#refs/heads/}" >"$GIT_DIR/head-name" + echo "${head#refs/heads/}" >"$GIT_DIR/BISECT_START" ;; *) die "Bad HEAD - strange symbolic ref" @@ -331,9 +333,9 @@ bisect_visualize() { if test $# = 0 then - case "${DISPLAY+set}" in + case "${DISPLAY+set}${MSYSTEM+set}${SECURITYSESSIONID+set}" in '') set git log ;; - set) set gitk ;; + set*) set gitk ;; esac else case "$1" in @@ -353,8 +355,8 @@ bisect_reset() { return } case "$#" in - 0) if [ -s "$GIT_DIR/head-name" ]; then - branch=`cat "$GIT_DIR/head-name"` + 0) if [ -s "$GIT_DIR/BISECT_START" ]; then + branch=`cat "$GIT_DIR/BISECT_START"` else branch=master fi ;; @@ -365,7 +367,9 @@ bisect_reset() { usage ;; esac if git checkout "$branch"; then + # Cleanup head-name if it got left by an old version of git-bisect rm -f "$GIT_DIR/head-name" + rm -f "$GIT_DIR/BISECT_START" bisect_clean_state fi }