diff options
Diffstat (limited to 'config.h')
-rw-r--r-- | config.h | 38 |
1 files changed, 36 insertions, 2 deletions
@@ -39,8 +39,8 @@ extern int git_default_config(const char *, const char *, void *); extern int git_config_from_file(config_fn_t fn, const char *, void *); extern int git_config_from_mem(config_fn_t fn, const enum config_origin_type, const char *name, const char *buf, size_t len, void *data); -extern int git_config_from_blob_sha1(config_fn_t fn, const char *name, - const unsigned char *sha1, void *data); +extern int git_config_from_blob_oid(config_fn_t fn, const char *name, + const struct object_id *oid, void *data); extern void git_config_push_parameter(const char *text); extern int git_config_from_parameters(config_fn_t fn, void *data); extern void read_early_config(config_fn_t cb, void *data); @@ -163,6 +163,40 @@ extern int git_configset_get_bool_or_int(struct config_set *cs, const char *key, extern int git_configset_get_maybe_bool(struct config_set *cs, const char *key, int *dest); extern int git_configset_get_pathname(struct config_set *cs, const char *key, const char **dest); +/* Functions for reading a repository's config */ +struct repository; +extern void repo_config(struct repository *repo, config_fn_t fn, void *data); +extern int repo_config_get_value(struct repository *repo, + const char *key, const char **value); +extern const struct string_list *repo_config_get_value_multi(struct repository *repo, + const char *key); +extern int repo_config_get_string_const(struct repository *repo, + const char *key, const char **dest); +extern int repo_config_get_string(struct repository *repo, + const char *key, char **dest); +extern int repo_config_get_int(struct repository *repo, + const char *key, int *dest); +extern int repo_config_get_ulong(struct repository *repo, + const char *key, unsigned long *dest); +extern int repo_config_get_bool(struct repository *repo, + const char *key, int *dest); +extern int repo_config_get_bool_or_int(struct repository *repo, + const char *key, int *is_bool, int *dest); +extern int repo_config_get_maybe_bool(struct repository *repo, + const char *key, int *dest); +extern int repo_config_get_pathname(struct repository *repo, + const char *key, const char **dest); + +/* + * Note: This function exists solely to maintain backward compatibility with + * 'fetch' and 'update_clone' storing configuration in '.gitmodules' and should + * NOT be used anywhere else. + * + * Runs the provided config function on the '.gitmodules' file found in the + * working directory. + */ +extern void config_from_gitmodules(config_fn_t fn, void *data); + extern int git_config_get_value(const char *key, const char **value); extern const struct string_list *git_config_get_value_multi(const char *key); extern void git_config_clear(void); |