2626/* Max depth for [include] directives */
2727#define MAX_INCLUDE_DEPTH 10
2828
29+ typedef struct diskfile {
30+ git_futils_filestamp stamp ;
31+ git_oid checksum ;
32+ char * path ;
33+ git_array_t (struct diskfile ) includes ;
34+ } diskfile ;
35+
2936typedef struct {
3037 git_config_backend parent ;
3138 /* mutex to coordinate accessing the values */
@@ -44,7 +51,7 @@ typedef struct {
4451 git_filebuf locked_buf ;
4552 git_buf locked_content ;
4653
47- git_config_file file ;
54+ diskfile file ;
4855} diskfile_backend ;
4956
5057typedef struct {
@@ -55,14 +62,14 @@ typedef struct {
5562
5663typedef struct {
5764 const git_repository * repo ;
58- git_config_file * file ;
65+ diskfile * file ;
5966 git_config_entries * entries ;
6067 git_config_level_t level ;
6168 unsigned int depth ;
6269} diskfile_parse_state ;
6370
64- static int config_read (git_config_entries * entries , const git_repository * repo , git_config_file * file , git_config_level_t level , int depth );
65- static int config_read_buffer (git_config_entries * entries , const git_repository * repo , git_config_file * file , git_config_level_t level , int depth , const char * buf , size_t buflen );
71+ static int config_read (git_config_entries * entries , const git_repository * repo , diskfile * file , git_config_level_t level , int depth );
72+ static int config_read_buffer (git_config_entries * entries , const git_repository * repo , diskfile * file , git_config_level_t level , int depth , const char * buf , size_t buflen );
6673static int config_write (diskfile_backend * cfg , const char * orig_key , const char * key , const p_regex_t * preg , const char * value );
6774static char * escape_value (const char * ptr );
6875
@@ -96,9 +103,9 @@ static git_config_entries *diskfile_entries_take(diskfile_header *h)
96103 return entries ;
97104}
98105
99- static void config_file_clear (git_config_file * file )
106+ static void config_file_clear (diskfile * file )
100107{
101- git_config_file * include ;
108+ diskfile * include ;
102109 uint32_t i ;
103110
104111 if (file == NULL )
@@ -134,9 +141,9 @@ static int config_open(git_config_backend *cfg, git_config_level_t level, const
134141 return res ;
135142}
136143
137- static int config_is_modified (int * modified , git_config_file * file )
144+ static int config_is_modified (int * modified , diskfile * file )
138145{
139- git_config_file * include ;
146+ diskfile * include ;
140147 git_buf buf = GIT_BUF_INIT ;
141148 git_oid hash ;
142149 uint32_t i ;
@@ -174,9 +181,9 @@ static int config_set_entries(git_config_backend *cfg, git_config_entries *entri
174181{
175182 diskfile_backend * b = (diskfile_backend * )cfg ;
176183 git_config_entries * old = NULL ;
177- git_config_file * include ;
184+ diskfile * include ;
178185 int error ;
179- size_t i ;
186+ uint32_t i ;
180187
181188 if (b -> header .parent .readonly )
182189 return config_error_readonly ();
@@ -679,7 +686,7 @@ static char *escape_value(const char *ptr)
679686
680687static int parse_include (diskfile_parse_state * parse_data , const char * file )
681688{
682- git_config_file * include ;
689+ diskfile * include ;
683690 git_buf path = GIT_BUF_INIT ;
684691 char * dir ;
685692 int result ;
@@ -873,7 +880,7 @@ static int read_on_variable(
873880static int config_read_buffer (
874881 git_config_entries * entries ,
875882 const git_repository * repo ,
876- git_config_file * file ,
883+ diskfile * file ,
877884 git_config_level_t level ,
878885 int depth ,
879886 const char * buf ,
@@ -913,7 +920,7 @@ static int config_read_buffer(
913920static int config_read (
914921 git_config_entries * entries ,
915922 const git_repository * repo ,
916- git_config_file * file ,
923+ diskfile * file ,
917924 git_config_level_t level ,
918925 int depth )
919926{
0 commit comments