diff mbox series

[10/23] fsck_describe_object(): build on our get_object_name() primitive

Message ID 20191018045638.GJ17879@sigill.intra.peff.net (mailing list archive)
State New, archived
Headers show
Series parsing and fsck cleanups | expand

Commit Message

Jeff King Oct. 18, 2019, 4:56 a.m. UTC
This isolates the implementation detail of using the decoration code to
our put/get functions.

Signed-off-by: Jeff King <peff@peff.net>
---
Arguably this could be squashed into the previous commit. By not doing
so, it made describe_object() more of a pure code movement.

 fsck.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

Comments

Junio C Hamano Oct. 24, 2019, 6:06 a.m. UTC | #1
Jeff King <peff@peff.net> writes:

> This isolates the implementation detail of using the decoration code to
> our put/get functions.
>
> Signed-off-by: Jeff King <peff@peff.net>
> ---
> Arguably this could be squashed into the previous commit. By not doing
> so, it made describe_object() more of a pure code movement.

Indeed it did.
diff mbox series

Patch

diff --git a/fsck.c b/fsck.c
index ecd5957362..b0c4de67c9 100644
--- 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);