Skip to content

Commit 95790ff

Browse files
tanayabhgitster
authored andcommitted
archive.c: replace git_config() with git_config_get_bool() family
Use `git_config_get_bool()` family instead of `git_config()` to take advantage of the config-set API which provides a cleaner control flow. Signed-off-by: Tanay Abhra <[email protected]> Reviewed-by: Matthieu Moy <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent b27a572 commit 95790ff

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

archive.c

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -402,14 +402,6 @@ static int parse_archive_args(int argc, const char **argv,
402402
return argc;
403403
}
404404

405-
static int git_default_archive_config(const char *var, const char *value,
406-
void *cb)
407-
{
408-
if (!strcmp(var, "uploadarchive.allowunreachable"))
409-
remote_allow_unreachable = git_config_bool(var, value);
410-
return git_default_config(var, value, cb);
411-
}
412-
413405
int write_archive(int argc, const char **argv, const char *prefix,
414406
int setup_prefix, const char *name_hint, int remote)
415407
{
@@ -420,7 +412,9 @@ int write_archive(int argc, const char **argv, const char *prefix,
420412
if (setup_prefix && prefix == NULL)
421413
prefix = setup_git_directory_gently(&nongit);
422414

423-
git_config(git_default_archive_config, NULL);
415+
git_config_get_bool("uploadarchive.allowunreachable", &remote_allow_unreachable);
416+
git_config(git_default_config, NULL);
417+
424418
init_tar_archiver();
425419
init_zip_archiver();
426420

0 commit comments

Comments
 (0)