]> git.ipfire.org Git - thirdparty/git.git/commitdiff
ls-tree: mark unused parameter in callback
authorJeff King <peff@peff.net>
Tue, 29 Aug 2023 23:45:19 +0000 (19:45 -0400)
committerJunio C Hamano <gitster@pobox.com>
Wed, 30 Aug 2023 00:56:24 +0000 (17:56 -0700)
The formatting functions are dispatched from a table of function
pointers. The "path name only" function unsurprisingly does not need to
look at its "oid" parameter, but we must mark it as unused to make
-Wunused-parameter happy.

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

index f558db5f3b80b3d72f5f66f008e3fa2072c2e8ed..209d2dc0d59af3d0c8860ef4eb397edb34e8b429 100644 (file)
@@ -241,7 +241,8 @@ static int show_tree_long(const struct object_id *oid, struct strbuf *base,
        return recurse;
 }
 
-static int show_tree_name_only(const struct object_id *oid, struct strbuf *base,
+static int show_tree_name_only(const struct object_id *oid UNUSED,
+                              struct strbuf *base,
                               const char *pathname, unsigned mode,
                               void *context)
 {