summaryrefslogtreecommitdiff
path: root/submodule-config.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2016-05-18 14:40:15 -0700
committerJunio C Hamano <gitster@pobox.com>2016-05-18 14:40:15 -0700
commit66106691a1b71e445fe5e4d6b8b043dffc7dfe4c (patch)
tree580fee1afc5f1b54fa2525fe461630a0f6b10c1b /submodule-config.c
parent989cbd455619e1e7b6156366ee7fd5376af683b6 (diff)
parent99dab16863c2eca584a84bdde748b9c113717603 (diff)
downloadgit-66106691a1b71e445fe5e4d6b8b043dffc7dfe4c.tar.gz
Merge branch 'sb/misc-cleanups' into HEAD
* sb/misc-cleanups: submodule-config: don't shadow `cache` config.c: drop local variable credential-cache, send_request: close fd when done bundle: don't leak an fd in case of early return abbrev_sha1_in_line: don't leak memory notes: don't leak memory in git_config_get_notes_strategy
Diffstat (limited to 'submodule-config.c')
-rw-r--r--submodule-config.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/submodule-config.c b/submodule-config.c
index 8476e0fa0f..7f67ec0c6a 100644
--- a/submodule-config.c
+++ b/submodule-config.c
@@ -30,7 +30,7 @@ enum lookup_type {
lookup_path
};
-static struct submodule_cache cache;
+static struct submodule_cache the_submodule_cache;
static int is_cache_init;
static int config_path_cmp(const struct submodule_entry *a,
@@ -457,14 +457,14 @@ static void ensure_cache_init(void)
if (is_cache_init)
return;
- cache_init(&cache);
+ cache_init(&the_submodule_cache);
is_cache_init = 1;
}
int parse_submodule_config_option(const char *var, const char *value)
{
struct parse_config_parameter parameter;
- parameter.cache = &cache;
+ parameter.cache = &the_submodule_cache;
parameter.commit_sha1 = NULL;
parameter.gitmodules_sha1 = null_sha1;
parameter.overwrite = 1;
@@ -477,18 +477,18 @@ const struct submodule *submodule_from_name(const unsigned char *commit_sha1,
const char *name)
{
ensure_cache_init();
- return config_from_name(&cache, commit_sha1, name);
+ return config_from_name(&the_submodule_cache, commit_sha1, name);
}
const struct submodule *submodule_from_path(const unsigned char *commit_sha1,
const char *path)
{
ensure_cache_init();
- return config_from_path(&cache, commit_sha1, path);
+ return config_from_path(&the_submodule_cache, commit_sha1, path);
}
void submodule_free(void)
{
- cache_free(&cache);
+ cache_free(&the_submodule_cache);
is_cache_init = 0;
}