diff options
author | Carlos Martín Nieto <cmn@dwim.me> | 2017-11-04 15:28:35 +0100 |
---|---|---|
committer | Carlos Martín Nieto <cmn@dwim.me> | 2017-11-18 19:27:24 +0100 |
commit | 158a42a55061fd021dbf301fb46440c9b1e5b8be (patch) | |
tree | 54bf79035af1111f1794f05451ebe4ce0fd95d9b | |
parent | 990d2b854ab7eef28dd09209f77ff95d8e6a4ca2 (diff) | |
download | libgit2-158a42a55061fd021dbf301fb46440c9b1e5b8be.tar.gz |
config: specify how we match the regular expressions
We do it the same as git does: case-sensitively on the normalized form of the
variable name.
While here also specify that we're case-sensitive on the values when handling
the values when setting or deleting multivars.
-rw-r--r-- | include/git2/config.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/include/git2/config.h b/include/git2/config.h index d0f1ba1b3..a6b02e6fc 100644 --- a/include/git2/config.h +++ b/include/git2/config.h @@ -398,6 +398,9 @@ GIT_EXTERN(int) git_config_get_string_buf(git_buf *out, const git_config *cfg, c * * The callback will be called on each variable found * + * The regular expression is applied case-sensitively on the normalized form of + * the variable name: the case-insensitive parts are lower-case. + * * @param cfg where to look for the variable * @param name the variable's name * @param regexp regular expression to filter which variables we're @@ -410,6 +413,9 @@ GIT_EXTERN(int) git_config_get_multivar_foreach(const git_config *cfg, const cha /** * Get each value of a multivar * + * The regular expression is applied case-sensitively on the normalized form of + * the variable name: the case-insensitive parts are lower-case. + * * @param out pointer to store the iterator * @param cfg where to look for the variable * @param name the variable's name @@ -487,6 +493,8 @@ GIT_EXTERN(int) git_config_set_string(git_config *cfg, const char *name, const c /** * Set a multivar in the local config file. * + * The regular expression is applied case-sensitively on the value. + * * @param cfg where to look for the variable * @param name the variable's name * @param regexp a regular expression to indicate which values to replace @@ -506,6 +514,8 @@ GIT_EXTERN(int) git_config_delete_entry(git_config *cfg, const char *name); /** * Deletes one or several entries from a multivar in the local config file. * + * The regular expression is applied case-sensitively on the value. + * * @param cfg where to look for the variables * @param name the variable's name * @param regexp a regular expression to indicate which values to delete @@ -552,6 +562,9 @@ GIT_EXTERN(int) git_config_iterator_new(git_config_iterator **out, const git_con * Use `git_config_next` to advance the iteration and * `git_config_iterator_free` when done. * + * The regular expression is applied case-sensitively on the normalized form of + * the variable name: the case-insensitive parts are lower-case. + * * @param out pointer to store the iterator * @param cfg where to ge the variables from * @param regexp regular expression to match the names @@ -568,6 +581,9 @@ GIT_EXTERN(int) git_config_iterator_glob_new(git_config_iterator **out, const gi * The pointers passed to the callback are only valid as long as the * iteration is ongoing. * + * The regular expression is applied case-sensitively on the normalized form of + * the variable name: the case-insensitive parts are lower-case. + * * @param cfg where to get the variables from * @param regexp regular expression to match against config names * @param callback the function to call on each variable @@ -693,6 +709,9 @@ GIT_EXTERN(int) git_config_parse_path(git_buf *out, const char *value); * This behaviors like `git_config_foreach_match` except instead of all config * entries it just enumerates through the given backend entry. * + * The regular expression is applied case-sensitively on the normalized form of + * the variable name: the case-insensitive parts are lower-case. + * * @param backend where to get the variables from * @param regexp regular expression to match against config names (can be NULL) * @param callback the function to call on each variable |