diff options
author | Jon Seymour <jon.seymour@gmail.com> | 2011-08-09 12:11:54 +1000 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2011-08-09 10:26:18 -0700 |
commit | 24c512803dadf61b2f7f8965735b7c3a03f6147e (patch) | |
tree | 5b2169e0f60b9f6565b7e3c25c46b1d63931007a /git-bisect.sh | |
parent | 43b8ff4b149bb3e17271608380b4a73c2e290b77 (diff) | |
download | git-24c512803dadf61b2f7f8965735b7c3a03f6147e.tar.gz |
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 <gitster@pobox.com>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Jon Seymour <jon.seymour@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-bisect.sh')
-rwxr-xr-x | git-bisect.sh | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/git-bisect.sh b/git-bisect.sh index 22c4da5a9a..e0ca3fb853 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 |