]> git.ipfire.org Git - thirdparty/git.git/commitdiff
gc: drop MAYBE_UNUSED annotation from used parameter
authorJeff King <peff@peff.net>
Thu, 29 Aug 2024 20:08:33 +0000 (16:08 -0400)
committerJunio C Hamano <gitster@pobox.com>
Thu, 29 Aug 2024 20:56:46 +0000 (13:56 -0700)
The "opts" parameter is always used, so marking it with MAYBE_UNUSED is
just confusing.

This annotation goes back to 41abfe15d9 (maintenance: add pack-refs
task, 2021-02-09), when it really was unused. Back then we did not have
the UNUSED macro that would complain if the code changed to use the
parameter. So when we started using it in bfc2f9eb8e (builtin/gc:
forward git-gc(1)'s `--auto` flag when packing refs, 2024-03-25), nobody
noticed.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/gc.c

index 427faf1cfe1bdb66ad251e2bc040f88bc06bc0ea..8b2ac649efd3a5f7ae594f372e12d42cd351bfd1 100644 (file)
@@ -260,7 +260,7 @@ static int pack_refs_condition(UNUSED struct gc_config *cfg)
        return 1;
 }
 
-static int maintenance_task_pack_refs(MAYBE_UNUSED struct maintenance_run_opts *opts,
+static int maintenance_task_pack_refs(struct maintenance_run_opts *opts,
                                      UNUSED struct gc_config *cfg)
 {
        struct child_process cmd = CHILD_PROCESS_INIT;