summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 473d331)
raw | patch | inline | side by side (parent: 473d331)
author | Johannes Schindelin <Johannes.Schindelin@gmx.de> | |
Sun, 10 Feb 2008 13:59:50 +0000 (13:59 +0000) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Mon, 11 Feb 2008 20:04:17 +0000 (12:04 -0800) |
Instead of insisting on a symbolic ref, bisect now accepts detached
HEADs, too.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
HEADs, too.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-bisect.sh | patch | blob | history | |
t/t6030-bisect-porcelain.sh | patch | blob | history |
diff --git a/git-bisect.sh b/git-bisect.sh
index 5385249890698632dedcaf8dda03d865f66abca9..393fa355849f88d6c5227f90cbf6cbb45b39631e 100755 (executable)
--- a/git-bisect.sh
+++ b/git-bisect.sh
. git-sh-setup
require_work_tree
+_x40='[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]'
+_x40="$_x40$_x40$_x40$_x40$_x40$_x40$_x40$_x40"
+
sq() {
@@PERL@@ -e '
for (@ARGV) {
# top-of-line master first!
#
head=$(GIT_DIR="$GIT_DIR" git symbolic-ref HEAD) ||
- die "Bad HEAD - I need a symbolic ref"
+ head=$(GIT_DIR="$GIT_DIR" git rev-parse --verify HEAD) ||
+ die "Bad HEAD - I need a HEAD"
case "$head" in
refs/heads/bisect)
if [ -s "$GIT_DIR/head-name" ]; then
fi
git checkout $branch || exit
;;
- refs/heads/*)
+ refs/heads/*|$_x40)
[ -s "$GIT_DIR/head-name" ] && die "won't bisect on seeked tree"
echo "${head#refs/heads/}" >"$GIT_DIR/head-name"
;;
index 2ba4b00e526eb00c5d236777f896772c6cad538b..ec71123f4be187c1399c90dc806dbae53cda5b7f 100755 (executable)
grep "$HASH6 is first bad commit" my_bisect_log.txt
'
+test_expect_success 'bisect starting with a detached HEAD' '
+
+ git bisect reset &&
+ git checkout master^ &&
+ HEAD=$(git rev-parse --verify HEAD) &&
+ git bisect start &&
+ test $HEAD = $(cat .git/head-name) &&
+ git bisect reset &&
+ test $HEAD = $(git rev-parse --verify HEAD)
+
+'
+
#
#
test_done