Skip to content

Commit 02a2d57

Browse files
committed
Merge branch 'jk/left-right-bitmap'
When called with '--left-right' and '--use-bitmap-index', 'rev-list' will produce output without any left/right markers, which has been corrected. * jk/left-right-bitmap: rev-list: skip bitmap traversal for --left-right
2 parents 1ee7dbd + 16a186f commit 02a2d57

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

builtin/rev-list.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -485,6 +485,13 @@ static int try_bitmap_traversal(struct rev_info *revs,
485485
if (revs->max_count >= 0)
486486
return -1;
487487

488+
/*
489+
* We can't know which commits were left/right in a single traversal,
490+
* and we don't yet know how to traverse them separately.
491+
*/
492+
if (revs->left_right)
493+
return -1;
494+
488495
bitmap_git = prepare_bitmap_walk(revs, filter_provided_objects);
489496
if (!bitmap_git)
490497
return -1;

t/t5310-pack-bitmaps.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -503,6 +503,18 @@ test_expect_success 'boundary-based traversal is used when requested' '
503503
done
504504
'
505505

506+
test_expect_success 'left-right not confused by bitmap index' '
507+
git rev-list --left-right other...HEAD >expect &&
508+
git rev-list --use-bitmap-index --left-right other...HEAD >actual &&
509+
test_cmp expect actual
510+
'
511+
512+
test_expect_success 'left-right count not confused by bitmap-index' '
513+
git rev-list --left-right --count other...HEAD >expect &&
514+
git rev-list --use-bitmap-index --left-right --count other...HEAD >actual &&
515+
test_cmp expect actual
516+
'
517+
506518
test_bitmap_cases "pack.writeBitmapLookupTable"
507519

508520
test_expect_success 'verify writing bitmap lookup table when enabled' '

0 commit comments

Comments
 (0)