Thread (36 messages) flat view 36 messages, 2 authors, 5d ago

Re: [PATCH 02/10] builtin/fsck: merge `fsck_obj_buffer()` and `fsck_obj()`

From: Karthik Nayak <hidden>
Date: 2026-08-27 10:03:13

Patrick Steinhardt [off-list ref] writes:
The interfaces of the functions `fsck_obj()` and `fsck_obj_buffer()` are
somewhat similar to one another. The only difference between those two
is that `fsck_obj()` takes an already-parsed object as input, whereas
`fsck_obj_buffer()` parses the buffer and then calls `fsck_obj()`.

Furthermore, `fsck_obj()` has no callers other than `fsck_obj_buffer()`.

Refactor the code by merging those two functions. This makes it obvious
which function does what, and it allows us to get rid of the early in
s/early/early return/ ?
`fsck_obj()` in case `SEEN` is set as the only caller unconditionally
clears that bit before calling it anyway.

Signed-off-by: Patrick Steinhardt <redacted>
---
 builtin/fsck.c | 47 ++++++++++++++++++++---------------------------
 1 file changed, 20 insertions(+), 27 deletions(-)
The patch looks good!

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help