Skip to content

Commit afe27c8

Browse files
avargitster
authored andcommitted
cocci: apply the "packfile.h" part of "the_repository.pending"
Apply the part of "the_repository.pending.cocci" pertaining to "packfile.h". Signed-off-by: Ævar Arnfjörð Bjarmason <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent bab8216 commit afe27c8

File tree

5 files changed

+6
-7
lines changed

5 files changed

+6
-7
lines changed

builtin/gc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ static uint64_t total_ram(void)
284284

285285
static uint64_t estimate_repack_memory(struct packed_git *pack)
286286
{
287-
unsigned long nr_objects = approximate_object_count();
287+
unsigned long nr_objects = repo_approximate_object_count(the_repository);
288288
size_t os_cache, heap;
289289

290290
if (!pack || !nr_objects)

commit-graph.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2360,7 +2360,7 @@ int write_commit_graph(struct object_directory *odb,
23602360
replace = ctx->opts->split_flags & COMMIT_GRAPH_SPLIT_REPLACE;
23612361
}
23622362

2363-
ctx->approx_nr_objects = approximate_object_count();
2363+
ctx->approx_nr_objects = repo_approximate_object_count(the_repository);
23642364

23652365
if (ctx->append && ctx->r->objects->commit_graph) {
23662366
struct commit_graph *g = ctx->r->objects->commit_graph;

contrib/coccinelle/the_repository.cocci

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,10 @@
9191
|
9292
- format_commit_message
9393
+ repo_format_commit_message
94+
// packfile.h
95+
|
96+
- approximate_object_count
97+
+ repo_approximate_object_count
9498
)
9599
(
96100
+ the_repository,

contrib/coccinelle/the_repository.pending.cocci

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,7 @@
55
@@
66
@@
77
(
8-
// packfile.h
9-
- approximate_object_count
10-
+ repo_approximate_object_count
118
// promisor-remote.h
12-
|
139
- promisor_remote_reinit
1410
+ repo_promisor_remote_reinit
1511
|

packfile.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ struct packed_git *get_all_packs(struct repository *r);
6565
* for speed.
6666
*/
6767
unsigned long repo_approximate_object_count(struct repository *r);
68-
#define approximate_object_count() repo_approximate_object_count(the_repository)
6968

7069
struct packed_git *find_sha1_pack(const unsigned char *sha1,
7170
struct packed_git *packs);

0 commit comments

Comments
 (0)