]> git.ipfire.org Git - thirdparty/git.git/commitdiff
cocci: apply the "packfile.h" part of "the_repository.pending"
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>
Tue, 28 Mar 2023 13:58:52 +0000 (15:58 +0200)
committerJunio C Hamano <gitster@pobox.com>
Tue, 28 Mar 2023 14:36:45 +0000 (07:36 -0700)
Apply the part of "the_repository.pending.cocci" pertaining to
"packfile.h".

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/gc.c
commit-graph.c
contrib/coccinelle/the_repository.cocci
contrib/coccinelle/the_repository.pending.cocci
packfile.h

index e60decbc56ca7e3bf701f67fc3cb79650e862c6b..bef26020f996ed82a2a6e186cc5c1ef9ccd27975 100644 (file)
@@ -284,7 +284,7 @@ static uint64_t total_ram(void)
 
 static uint64_t estimate_repack_memory(struct packed_git *pack)
 {
-       unsigned long nr_objects = approximate_object_count();
+       unsigned long nr_objects = repo_approximate_object_count(the_repository);
        size_t os_cache, heap;
 
        if (!pack || !nr_objects)
index 8273085aa60b57c4936cc9417bad63a7f018de0f..268410e913cc2e6c999d7b4210ce49b4031985de 100644 (file)
@@ -2360,7 +2360,7 @@ int write_commit_graph(struct object_directory *odb,
                        replace = ctx->opts->split_flags & COMMIT_GRAPH_SPLIT_REPLACE;
        }
 
-       ctx->approx_nr_objects = approximate_object_count();
+       ctx->approx_nr_objects = repo_approximate_object_count(the_repository);
 
        if (ctx->append && ctx->r->objects->commit_graph) {
                struct commit_graph *g = ctx->r->objects->commit_graph;
index ff4c56114f1de57946668bd3925e929c72bc027f..a325361f961aafff39426fce4c1cc2eb45911db3 100644 (file)
 |
 - format_commit_message
 + repo_format_commit_message
+// packfile.h
+|
+- approximate_object_count
++ repo_approximate_object_count
 )
   (
 + the_repository,
index 375850e773c34bde7586095825f7663c598dd1ae..9b426e49e665069f631fb4f38fcf548f53722eda 100644 (file)
@@ -5,11 +5,7 @@
 @@
 @@
 (
-// packfile.h
-- approximate_object_count
-+ repo_approximate_object_count
 // promisor-remote.h
-|
 - promisor_remote_reinit
 + repo_promisor_remote_reinit
 |
index a3f6723857bf120f611e4f506e85428132f7ccc3..6ec16567971821407774f96de2fc7cfe0ae15b07 100644 (file)
@@ -65,7 +65,6 @@ struct packed_git *get_all_packs(struct repository *r);
  * for speed.
  */
 unsigned long repo_approximate_object_count(struct repository *r);
-#define approximate_object_count() repo_approximate_object_count(the_repository)
 
 struct packed_git *find_sha1_pack(const unsigned char *sha1,
                                  struct packed_git *packs);