summaryrefslogtreecommitdiff
path: root/repository.h
diff options
context:
space:
mode:
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>2022-03-04 18:32:17 (GMT)
committerJunio C Hamano <gitster@pobox.com>2022-03-04 21:24:19 (GMT)
commit759f34073807119ffb935a84aa86e6a8fa7a9bc4 (patch)
tree1a7587a86da6c9b94f064b5faa950832ca864764 /repository.h
parent2d102c2bca1a0c50f17108189f134279cad941cd (diff)
downloadgit-759f34073807119ffb935a84aa86e6a8fa7a9bc4.zip
git-759f34073807119ffb935a84aa86e6a8fa7a9bc4.tar.gz
git-759f34073807119ffb935a84aa86e6a8fa7a9bc4.tar.bz2
repository.c: free the "path cache" in repo_clear()
The "struct path_cache" added in 102de880d24 (path.c: migrate global git_path_* to take a repository argument, 2018-05-17) is only used directly by code in repository.[ch] (but populated in path.[ch]). Let's move this code to repository.[ch], and stop leaking this memory when we run repo_clear(). To avoid the cast change it from a "const char *" to a "char *". This also removes the "PATH_CACHE_INIT" macro, which has never been used for anything. For the "struct repository" we already make a hard assumption that it (and "the_repository") can be identically initialized by making it a "static" variable, so making use of a "PATH_CACHE_INIT" somewhere would have been confusing. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'repository.h')
-rw-r--r--repository.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/repository.h b/repository.h
index ca837cb..e29f361 100644
--- a/repository.h
+++ b/repository.h
@@ -44,6 +44,18 @@ struct repo_settings {
int core_multi_pack_index;
};
+struct repo_path_cache {
+ char *squash_msg;
+ char *merge_msg;
+ char *merge_rr;
+ char *merge_mode;
+ char *merge_head;
+ char *merge_autostash;
+ char *auto_merge;
+ char *fetch_head;
+ char *shallow;
+};
+
struct repository {
/* Environment */
/*
@@ -82,7 +94,7 @@ struct repository {
/*
* Contains path to often used file names.
*/
- struct path_cache cached_paths;
+ struct repo_path_cache cached_paths;
/*
* Path to the repository's graft file.