]> git.ipfire.org Git - thirdparty/git.git/commitdiff
fsck_describe_object(): build on our get_object_name() primitive
authorJeff King <peff@peff.net>
Fri, 18 Oct 2019 04:56:38 +0000 (00:56 -0400)
committerJunio C Hamano <gitster@pobox.com>
Mon, 28 Oct 2019 05:05:17 +0000 (14:05 +0900)
This isolates the implementation detail of using the decoration code to
our put/get functions.

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

diff --git a/fsck.c b/fsck.c
index ecd5957362cb230097ab3e191b44666a3920096a..b0c4de67c9f4724431e2b864d143b4f69c4e5db9 100644 (file)
--- a/fsck.c
+++ b/fsck.c
@@ -351,10 +351,7 @@ const char *fsck_describe_object(struct fsck_options *options,
        };
        static int b = 0;
        struct strbuf *buf;
-       char *name = NULL;
-
-       if (options->object_names)
-               name = lookup_decoration(options->object_names, obj);
+       const char *name = fsck_get_object_name(options, obj);
 
        buf = bufs + b;
        b = (b + 1) % ARRAY_SIZE(bufs);