]> git.ipfire.org Git - thirdparty/git.git/commitdiff
config: make git_configset_get_string_tmp() private
authorDerrick Stolee <dstolee@microsoft.com>
Mon, 7 Feb 2022 21:33:03 +0000 (21:33 +0000)
committerJunio C Hamano <gitster@pobox.com>
Tue, 8 Feb 2022 17:49:21 +0000 (09:49 -0800)
This method was created in f1de981e8 (config: fix leaks from
git_config_get_string_const(), 2020-08-14) but its only use was in the
repo_config_get_string_tmp() method, also declared in config.h and
implemented in config.c. Since this is otherwise unused and is a very
similar implementation to git_configset_get_value(), let's remove this
declaration.

Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Reviewed-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
config.c
config.h

index 1a03ced1a54cd794da1e82b85bc28da6bfa6bb1d..870b22dd2fff13b7e5fc34af0fb93fcfadde6150 100644 (file)
--- a/config.c
+++ b/config.c
@@ -2179,8 +2179,8 @@ int git_configset_get_string(struct config_set *cs, const char *key, char **dest
                return 1;
 }
 
-int git_configset_get_string_tmp(struct config_set *cs, const char *key,
-                                const char **dest)
+static int git_configset_get_string_tmp(struct config_set *cs, const char *key,
+                                       const char **dest)
 {
        const char *value;
        if (!git_configset_get_value(cs, key, &value)) {
index 1d98ad269bdc07f38a9506baf14276c8996c4e66..184aef1eca4ba910f7a037a9b74282359959ada6 100644 (file)
--- a/config.h
+++ b/config.h
@@ -494,7 +494,6 @@ void git_configset_clear(struct config_set *cs);
 int git_configset_get_value(struct config_set *cs, const char *key, const char **dest);
 
 int git_configset_get_string(struct config_set *cs, const char *key, char **dest);
-int git_configset_get_string_tmp(struct config_set *cs, const char *key, const char **dest);
 int git_configset_get_int(struct config_set *cs, const char *key, int *dest);
 int git_configset_get_ulong(struct config_set *cs, const char *key, unsigned long *dest);
 int git_configset_get_bool(struct config_set *cs, const char *key, int *dest);