diff options
author | Kirill A. Shutemov <kirill@shutemov.name> | 2014-02-19 00:58:54 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2014-02-18 16:12:13 -0800 |
commit | c8985ce05360857733738561dd6cdf964470cbdf (patch) | |
tree | 3435c93484d5e89639c41d2e9a101282f4ab71be /config.c | |
parent | 6aea9f0fdd2f013e9b63137727c73da02d42a1be (diff) | |
download | git-c8985ce05360857733738561dd6cdf964470cbdf.tar.gz |
config: change git_config_with_options() interface
We're going to have more options for config source.
Let's alter git_config_with_options() interface to accept struct with
all source options.
Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'config.c')
-rw-r--r-- | config.c | 13 |
1 files changed, 6 insertions, 7 deletions
@@ -1172,8 +1172,7 @@ int git_config_early(config_fn_t fn, void *data, const char *repo_config) } int git_config_with_options(config_fn_t fn, void *data, - const char *filename, - const char *blob_ref, + struct git_config_source *config_source, int respect_includes) { char *repo_config = NULL; @@ -1191,10 +1190,10 @@ int git_config_with_options(config_fn_t fn, void *data, * If we have a specific filename, use it. Otherwise, follow the * regular lookup sequence. */ - if (filename) - return git_config_from_file(fn, filename, data); - else if (blob_ref) - return git_config_from_blob_ref(fn, blob_ref, data); + if (config_source && config_source->file) + return git_config_from_file(fn, config_source->file, data); + else if (config_source && config_source->blob) + return git_config_from_blob_ref(fn, config_source->blob, data); repo_config = git_pathdup("config"); ret = git_config_early(fn, data, repo_config); @@ -1205,7 +1204,7 @@ int git_config_with_options(config_fn_t fn, void *data, int git_config(config_fn_t fn, void *data) { - return git_config_with_options(fn, data, NULL, NULL, 1); + return git_config_with_options(fn, data, NULL, 1); } /* |