fsck.c: refactor and rename common config callback

Refactor code I recently changed in 1f3299fda9 (fsck: make
fsck_config() re-usable, 2021-01-05) so that I could use fsck's config
callback in mktag in 1f3299fda9 (fsck: make fsck_config() re-usable,
2021-01-05).

I don't know what I was thinking in structuring the code this way, but
it clearly makes no sense to have an fsck_config_internal() at all
just so it can get a fsck_options when git_config() already supports
passing along some void* data.

Let's just make use of that instead, which gets us rid of the two
wrapper functions, and brings fsck's common config callback in line
with other such reusable config callbacks.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Ævar Arnfjörð Bjarmason
2021-03-17 19:20:36 +01:00
committed by Junio C Hamano
parent a5828ae6b5
commit fb79f5bff7
4 changed files with 5 additions and 16 deletions

4
fsck.c
View File

@ -1323,9 +1323,9 @@ int fsck_finish(struct fsck_options *options)
return ret;
}
int fsck_config_internal(const char *var, const char *value, void *cb,
struct fsck_options *options)
int git_fsck_config(const char *var, const char *value, void *cb)
{
struct fsck_options *options = cb;
if (strcmp(var, "fsck.skiplist") == 0) {
const char *path;
struct strbuf sb = STRBUF_INIT;