git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 1/2] pack-bitmap: drop repository argument from prepare_midx_bitmap_git()

From
Jeff King <peff@peff.net>
Date
Sep 9, 2021, 19:56 UTC
Message-ID
<YTpnCsqXdzeFp8Uz@coredump.intra.peff.net>
In-Reply-To
<YTpms9UnVsx+uu/2@coredump.intra.peff.net>

We never look at the repository argument which is passed. This makes sense, since the multi_pack_index struct already tells us everything we need to access the files in its associated object directory.

Signed-off-by: Jeff King <peff@peff.net>
---
 midx.c        | 2 +-
 pack-bitmap.c | 3 +--
 pack-bitmap.h | 3 +--
 3 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/midx.c b/midx.c
index ccdc3e5702..864034a6ad 100644
--- a/midx.c
+++ b/midx.c
@@ -1144,7 +1144,7 @@ static int write_midx_internal(const char *object_dir,
 		int bitmap_exists;
 		int want_bitmap = flags & MIDX_WRITE_BITMAP;
 
-		bitmap_git = prepare_midx_bitmap_git(the_repository, ctx.m);
+		bitmap_git = prepare_midx_bitmap_git(ctx.m);
 		bitmap_exists = bitmap_git && bitmap_is_midx(bitmap_git);
 		free_bitmap_index(bitmap_git);
 
diff --git a/pack-bitmap.c b/pack-bitmap.c
index fa69ed7a6d..f2a7994a9c 100644
--- a/pack-bitmap.c
+++ b/pack-bitmap.c
@@ -517,8 +517,7 @@ struct bitmap_index *prepare_bitmap_git(struct repository *r)
 	return NULL;
 }
 
-struct bitmap_index *prepare_midx_bitmap_git(struct repository *r,
-					     struct multi_pack_index *midx)
+struct bitmap_index *prepare_midx_bitmap_git(struct multi_pack_index *midx)
 {
 	struct bitmap_index *bitmap_git = xcalloc(1, sizeof(*bitmap_git));
 
diff --git a/pack-bitmap.h b/pack-bitmap.h
index 81664f933f..469090bad2 100644
--- a/pack-bitmap.h
+++ b/pack-bitmap.h
@@ -44,8 +44,7 @@ typedef int (*show_reachable_fn)(
 struct bitmap_index;
 
 struct bitmap_index *prepare_bitmap_git(struct repository *r);
-struct bitmap_index *prepare_midx_bitmap_git(struct repository *r,
-					     struct multi_pack_index *midx);
+struct bitmap_index *prepare_midx_bitmap_git(struct multi_pack_index *midx);
 void count_bitmap_commit_list(struct bitmap_index *, uint32_t *commits,
 			      uint32_t *trees, uint32_t *blobs, uint32_t *tags);
 void traverse_bitmap_commit_list(struct bitmap_index *,
-- 
2.33.0.621.ga797e945d8
Previous: Jeff KingNext: Jeff King
Message 2 of 4 in “-Wunused-parameter clenaups on tb/multi-pack-bitmaps”
  1. 0/2 -Wunused-parameter clenaups on tb/multi-pack-bitmapsJeff King, Sep 9, 2021
  2. 1/2 pack-bitmap: drop repository argument from prepare_midx_bitmap_git()Jeff King, Sep 9, 2021
  3. 2/2 pack-bitmap: drop bitmap_index argument from try_partial_reuse()Jeff King, Sep 9, 2021
  4. Taylor BlauSep 9, 2021

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.