]> git.ipfire.org Git - thirdparty/git.git/commitdiff
pack-bitmap: drop bitmap_index argument from try_partial_reuse()
authorJeff King <peff@peff.net>
Thu, 9 Sep 2021 19:57:21 +0000 (15:57 -0400)
committerJunio C Hamano <gitster@pobox.com>
Fri, 10 Sep 2021 00:32:40 +0000 (17:32 -0700)
Starting in commit 0f533c7284 (pack-bitmap: read multi-pack bitmaps,
2021-08-31), we no longer look at the "struct bitmap_index" passed to
try_partial_reuse(). This is because we only handle verbatim reuse from
a single pack: either the pack whose bitmap we're looking at, or the
"preferred" pack of a midx bitmap. And thus the primary item we look at
is the "pack" parameter added by that same commit, and not the
bitmap_git->pack parameter (which would be NULL for a midx bitmap). It's
our caller, reuse_partial_packfile_from_bitmap(), which decides which
pack to use and passes it in to us.

Drop the unused parameter to prevent confusion.

Signed-off-by: Jeff King <peff@peff.net>
Reviewed-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
pack-bitmap.c

index f2a7994a9ccf553262d5f5050026dda558532fc8..8504110a4daa9013304bc545bc529d6f8c3a8446 100644 (file)
@@ -1328,8 +1328,7 @@ cleanup:
  * -1 means "stop trying further objects"; 0 means we may or may not have
  * reused, but you can keep feeding bits.
  */
-static int try_partial_reuse(struct bitmap_index *bitmap_git,
-                            struct packed_git *pack,
+static int try_partial_reuse(struct packed_git *pack,
                             size_t pos,
                             struct bitmap *reuse,
                             struct pack_window **w_curs)
@@ -1476,7 +1475,7 @@ int reuse_partial_packfile_from_bitmap(struct bitmap_index *bitmap_git,
                                break;
 
                        offset += ewah_bit_ctz64(word >> offset);
-                       if (try_partial_reuse(bitmap_git, pack, pos + offset,
+                       if (try_partial_reuse(pack, pos + offset,
                                              reuse, &w_curs) < 0) {
                                /*
                                 * try_partial_reuse indicated we couldn't reuse