From: Junio C Hamano Date: Sun, 7 Mar 2010 22:53:35 +0000 (-0800) Subject: Merge branch 'cc/maint-bisect-paths' into maint-1.6.6 X-Git-Tag: v1.7.0.3~33^2~7 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/7f43e75adc1c238f27a89b4e7a30a1c874fd01f9?hp=e8a285e553f8c6c04820a542b2a28816a9d62d3c Merge branch 'cc/maint-bisect-paths' into maint-1.6.6 * cc/maint-bisect-paths: bisect: error out when passing bad path parameters --- diff --git a/bisect.c b/bisect.c index b779a9589a..e4214c9909 100644 --- a/bisect.c +++ b/bisect.c @@ -986,6 +986,12 @@ int bisect_next_all(const char *prefix) exit(1); } + if (!all) { + fprintf(stderr, "No testable commit found.\n" + "Maybe you started with bad path parameters?\n"); + exit(4); + } + bisect_rev = revs.commits->item->object.sha1; memcpy(bisect_rev_hex, sha1_to_hex(bisect_rev), 41); diff --git a/t/t6030-bisect-porcelain.sh b/t/t6030-bisect-porcelain.sh index def397c53a..dc9e8d030a 100755 --- a/t/t6030-bisect-porcelain.sh +++ b/t/t6030-bisect-porcelain.sh @@ -567,6 +567,11 @@ test_expect_success 'skipping away from skipped commit' ' test "$para3" = "$PARA_HASH3" ' +test_expect_success 'erroring out when using bad path parameters' ' + test_must_fail git bisect start $PARA_HASH7 $HASH1 -- foobar 2> error.txt && + grep "bad path parameters" error.txt +' + # # test_done