From 24c512803dadf61b2f7f8965735b7c3a03f6147e Mon Sep 17 00:00:00 2001 From: Jon Seymour Date: Tue, 9 Aug 2011 12:11:54 +1000 Subject: bisect: add support for bisecting bare repositories This enhances the support for bisecting history in bare repositories. The "git bisect" command no longer needs to be run inside a repository with a working tree; it defaults to --no-checkout when run in a bare repository. Two tests are included to demonstrate this behaviour. Suggested-by: Junio C Hamano Reviewed-by: Jonathan Nieder Signed-off-by: Jon Seymour Signed-off-by: Junio C Hamano --- git-bisect.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'git-bisect.sh') diff --git a/git-bisect.sh b/git-bisect.sh index 22c4da5a9..e0ca3fb85 100755 --- a/git-bisect.sh +++ b/git-bisect.sh @@ -29,7 +29,6 @@ Please use "git help bisect" to get the full man page.' OPTIONS_SPEC= . git-sh-setup . git-sh-i18n -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" @@ -79,7 +78,12 @@ bisect_start() { orig_args=$(git rev-parse --sq-quote "$@") bad_seen=0 eval='' - mode='' + if test "z$(git rev-parse --is-bare-repository)" != zfalse + then + mode=--no-checkout + else + mode='' + fi while [ $# -gt 0 ]; do arg="$1" case "$arg" in -- cgit v1.2.1