summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2008-02-27 19:56:08 (GMT)
committerJunio C Hamano <gitster@pobox.com>2008-02-27 19:56:08 (GMT)
commit722f53ca2feed5e41c2270fdaae25bde5b7582f4 (patch)
tree42bc9e92378e31f58631a7ab563ce0b0de6dcf87
parentd87aa329354be3d93c70547f4ed6fe52103ed1b5 (diff)
parentb577bb925e745845155c6f51eae841c339ce68f6 (diff)
downloadgit-722f53ca2feed5e41c2270fdaae25bde5b7582f4.zip
git-722f53ca2feed5e41c2270fdaae25bde5b7582f4.tar.gz
git-722f53ca2feed5e41c2270fdaae25bde5b7582f4.tar.bz2
Merge branch 'cw/bisect'
* cw/bisect: Eliminate confusing "won't bisect on seeked tree" failure
-rwxr-xr-xgit-bisect.sh14
-rwxr-xr-xt/t6030-bisect-porcelain.sh2
2 files changed, 10 insertions, 6 deletions
diff --git a/git-bisect.sh b/git-bisect.sh
index 74715ed..2c32d0b 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"
@@ -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
}
diff --git a/t/t6030-bisect-porcelain.sh b/t/t6030-bisect-porcelain.sh
index ec71123..4908e87 100755
--- a/t/t6030-bisect-porcelain.sh
+++ b/t/t6030-bisect-porcelain.sh
@@ -260,7 +260,7 @@ test_expect_success 'bisect starting with a detached HEAD' '
git checkout master^ &&
HEAD=$(git rev-parse --verify HEAD) &&
git bisect start &&
- test $HEAD = $(cat .git/head-name) &&
+ test $HEAD = $(cat .git/BISECT_START) &&
git bisect reset &&
test $HEAD = $(git rev-parse --verify HEAD)