summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTanay Abhra <tanayabh@gmail.com>2014-08-07 16:21:19 (GMT)
committerJunio C Hamano <gitster@pobox.com>2014-08-07 20:33:27 (GMT)
commit95790ff60d35e6a9e212fa0f9ffedaabddd1182c (patch)
treed092d45af65b4c90153bae12e492b6bee4c25dfa
parentb27a5720996172fbb2cc809f88f4eea09b5bbc42 (diff)
downloadgit-95790ff60d35e6a9e212fa0f9ffedaabddd1182c.zip
git-95790ff60d35e6a9e212fa0f9ffedaabddd1182c.tar.gz
git-95790ff60d35e6a9e212fa0f9ffedaabddd1182c.tar.bz2
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>
-rw-r--r--archive.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/archive.c b/archive.c
index 3fc0fb2..952a659 100644
--- a/archive.c
+++ b/archive.c
@@ -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();