diff options
author | Tanay Abhra <tanayabh@gmail.com> | 2014-08-07 09:21:19 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2014-08-07 13:33:27 -0700 |
commit | 95790ff60d35e6a9e212fa0f9ffedaabddd1182c (patch) | |
tree | d092d45af65b4c90153bae12e492b6bee4c25dfa /archive.c | |
parent | read-cache.c: replace `git_config()` with `git_config_get_*()` family (diff) | |
download | tgif-95790ff60d35e6a9e212fa0f9ffedaabddd1182c.tar.xz |
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>
Diffstat (limited to 'archive.c')
-rw-r--r-- | archive.c | 12 |
1 files changed, 3 insertions, 9 deletions
@@ -402,14 +402,6 @@ static int parse_archive_args(int argc, const char **argv, return argc; } -static int git_default_archive_config(const char *var, const char *value, - void *cb) -{ - if (!strcmp(var, "uploadarchive.allowunreachable")) - remote_allow_unreachable = git_config_bool(var, value); - return git_default_config(var, value, cb); -} - int write_archive(int argc, const char **argv, const char *prefix, int setup_prefix, const char *name_hint, int remote) { @@ -420,7 +412,9 @@ int write_archive(int argc, const char **argv, const char *prefix, if (setup_prefix && prefix == NULL) prefix = setup_git_directory_gently(&nongit); - git_config(git_default_archive_config, NULL); + git_config_get_bool("uploadarchive.allowunreachable", &remote_allow_unreachable); + git_config(git_default_config, NULL); + init_tar_archiver(); init_zip_archiver(); |