Bisect: use "$GIT_DIR/BISECT_NAMES" to check if we are bisecting.
Previously we tested if the "$GIT_DIR/refs/bisect" directory existed, to check if we were bisecting. Now with packed refs, it is simpler to check if the file "$GIT_DIR/BISECT_NAMES" exists, as it is already created when starting bisection and removed when reseting bisection. Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
e3f062bfd4
commit
6459c7c678
@ -36,7 +36,7 @@ sq() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bisect_autostart() {
|
bisect_autostart() {
|
||||||
test -d "$GIT_DIR/refs/bisect" || {
|
test -f "$GIT_DIR/BISECT_NAMES" || {
|
||||||
echo >&2 'You need to start by "git bisect start"'
|
echo >&2 'You need to start by "git bisect start"'
|
||||||
if test -t 0
|
if test -t 0
|
||||||
then
|
then
|
||||||
@ -82,7 +82,6 @@ bisect_start() {
|
|||||||
# Get rid of any old bisect state
|
# Get rid of any old bisect state
|
||||||
#
|
#
|
||||||
bisect_clean_state
|
bisect_clean_state
|
||||||
mkdir "$GIT_DIR/refs/bisect"
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Check for one bad and then some good revisions.
|
# Check for one bad and then some good revisions.
|
||||||
@ -191,7 +190,7 @@ bisect_next_check() {
|
|||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
THEN=''
|
THEN=''
|
||||||
test -d "$GIT_DIR/refs/bisect" || {
|
test -f "$GIT_DIR/BISECT_NAMES" || {
|
||||||
echo >&2 'You need to start by "git bisect start".'
|
echo >&2 'You need to start by "git bisect start".'
|
||||||
THEN='then '
|
THEN='then '
|
||||||
}
|
}
|
||||||
@ -348,8 +347,6 @@ bisect_reset() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bisect_clean_state() {
|
bisect_clean_state() {
|
||||||
rm -fr "$GIT_DIR/refs/bisect"
|
|
||||||
|
|
||||||
# There may be some refs packed during bisection.
|
# There may be some refs packed during bisection.
|
||||||
git for-each-ref --format='%(refname) %(objectname)' refs/bisect/\* refs/heads/bisect |
|
git for-each-ref --format='%(refname) %(objectname)' refs/bisect/\* refs/heads/bisect |
|
||||||
while read ref hash
|
while read ref hash
|
||||||
|
Loading…
Reference in New Issue
Block a user