Skip to content

Commit

Permalink
Merge branch 'jk/left-right-bitmap'
Browse files Browse the repository at this point in the history
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
  • Loading branch information
gitster committed Nov 8, 2024
2 parents 1ee7dbd + 16a186f commit 02a2d57
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
7 changes: 7 additions & 0 deletions builtin/rev-list.c
Original file line number Diff line number Diff line change
Expand Up @@ -485,6 +485,13 @@ static int try_bitmap_traversal(struct rev_info *revs,
if (revs->max_count >= 0)
return -1;

/*
* We can't know which commits were left/right in a single traversal,
* and we don't yet know how to traverse them separately.
*/
if (revs->left_right)
return -1;

bitmap_git = prepare_bitmap_walk(revs, filter_provided_objects);
if (!bitmap_git)
return -1;
Expand Down
12 changes: 12 additions & 0 deletions t/t5310-pack-bitmaps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -503,6 +503,18 @@ test_expect_success 'boundary-based traversal is used when requested' '
done
'

test_expect_success 'left-right not confused by bitmap index' '
git rev-list --left-right other...HEAD >expect &&
git rev-list --use-bitmap-index --left-right other...HEAD >actual &&
test_cmp expect actual
'

test_expect_success 'left-right count not confused by bitmap-index' '
git rev-list --left-right --count other...HEAD >expect &&
git rev-list --use-bitmap-index --left-right --count other...HEAD >actual &&
test_cmp expect actual
'

test_bitmap_cases "pack.writeBitmapLookupTable"

test_expect_success 'verify writing bitmap lookup table when enabled' '
Expand Down

0 comments on commit 02a2d57

Please sign in to comment.