aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bisect.c2
-rwxr-xr-xt/t6002-rev-list-bisect.sh5
2 files changed, 5 insertions, 2 deletions
diff --git a/bisect.c b/bisect.c
index f6fa5c235f..d71c4e4b44 100644
--- a/bisect.c
+++ b/bisect.c
@@ -442,8 +442,6 @@ void find_bisection(struct commit_list **commit_list, int *reaches,
best->next = NULL;
}
*reaches = weight(best);
- } else {
- free_commit_list(*commit_list);
}
*commit_list = best;
diff --git a/t/t6002-rev-list-bisect.sh b/t/t6002-rev-list-bisect.sh
index b95a0212ad..daa009c9a1 100755
--- a/t/t6002-rev-list-bisect.sh
+++ b/t/t6002-rev-list-bisect.sh
@@ -308,4 +308,9 @@ test_expect_success '--bisect-all --first-parent' '
test_cmp expect actual
'
+test_expect_success '--bisect without any revisions' '
+ git rev-list --bisect HEAD..HEAD >out &&
+ test_must_be_empty out
+'
+
test_done