Skip to content

Commit 7f43e75

Browse files
committed
Merge branch 'cc/maint-bisect-paths' into maint-1.6.6
* cc/maint-bisect-paths: bisect: error out when passing bad path parameters
2 parents e8a285e + 8f69f72 commit 7f43e75

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

bisect.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -986,6 +986,12 @@ int bisect_next_all(const char *prefix)
986986
exit(1);
987987
}
988988

989+
if (!all) {
990+
fprintf(stderr, "No testable commit found.\n"
991+
"Maybe you started with bad path parameters?\n");
992+
exit(4);
993+
}
994+
989995
bisect_rev = revs.commits->item->object.sha1;
990996
memcpy(bisect_rev_hex, sha1_to_hex(bisect_rev), 41);
991997

t/t6030-bisect-porcelain.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -567,6 +567,11 @@ test_expect_success 'skipping away from skipped commit' '
567567
test "$para3" = "$PARA_HASH3"
568568
'
569569

570+
test_expect_success 'erroring out when using bad path parameters' '
571+
test_must_fail git bisect start $PARA_HASH7 $HASH1 -- foobar 2> error.txt &&
572+
grep "bad path parameters" error.txt
573+
'
574+
570575
#
571576
#
572577
test_done

0 commit comments

Comments
 (0)