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 <tanayabh@gmail.com> Reviewed-by: Matthieu Moy <Matthieu.Moy@imag.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Tanay Abhra committed
Aug 7, 2014 at 09:21 UTC
95790ff60d35e6a9e212fa0f9ffedaabddd1182c
1 file changed
+3
-9
archive.c
+3
-9
@@ -402,14 +402,6 @@ static int parse_archive_args(int argc, const char **argv,
402
return argc;
403
}
404
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
-
405
int write_archive(int argc, const char **argv, const char *prefix,
406
int setup_prefix, const char *name_hint, int remote)
407
{
@@ -420,7 +412,9 @@ int write_archive(int argc, const char **argv, const char *prefix,
412
if (setup_prefix && prefix == NULL)
413
prefix = setup_git_directory_gently(&nongit);
414
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
+
418
init_tar_archiver();
419
init_zip_archiver();
420