@@ -64,24 +64,24 @@ int git_config_list_dup_entry(git_config_list *config_list, const git_config_ent
64
64
duplicated = git__calloc (1 , sizeof (git_config_list_entry ));
65
65
GIT_ERROR_CHECK_ALLOC (duplicated );
66
66
67
- duplicated -> base .name = git__strdup (entry -> name );
68
- GIT_ERROR_CHECK_ALLOC (duplicated -> base .name );
67
+ duplicated -> base .entry . name = git__strdup (entry -> name );
68
+ GIT_ERROR_CHECK_ALLOC (duplicated -> base .entry . name );
69
69
70
70
if (entry -> value ) {
71
- duplicated -> base .value = git__strdup (entry -> value );
72
- GIT_ERROR_CHECK_ALLOC (duplicated -> base .value );
71
+ duplicated -> base .entry . value = git__strdup (entry -> value );
72
+ GIT_ERROR_CHECK_ALLOC (duplicated -> base .entry . value );
73
73
}
74
74
75
- duplicated -> base .backend_type = git_config_list_add_string (config_list , entry -> backend_type );
76
- GIT_ERROR_CHECK_ALLOC (duplicated -> base .backend_type );
75
+ duplicated -> base .entry . backend_type = git_config_list_add_string (config_list , entry -> backend_type );
76
+ GIT_ERROR_CHECK_ALLOC (duplicated -> base .entry . backend_type );
77
77
78
78
if (entry -> origin_path ) {
79
- duplicated -> base .origin_path = git_config_list_add_string (config_list , entry -> origin_path );
80
- GIT_ERROR_CHECK_ALLOC (duplicated -> base .origin_path );
79
+ duplicated -> base .entry . origin_path = git_config_list_add_string (config_list , entry -> origin_path );
80
+ GIT_ERROR_CHECK_ALLOC (duplicated -> base .entry . origin_path );
81
81
}
82
82
83
- duplicated -> base .level = entry -> level ;
84
- duplicated -> base .include_depth = entry -> include_depth ;
83
+ duplicated -> base .entry . level = entry -> level ;
84
+ duplicated -> base .entry . include_depth = entry -> include_depth ;
85
85
duplicated -> base .free = git_config_list_entry_free ;
86
86
duplicated -> config_list = config_list ;
87
87
@@ -90,8 +90,8 @@ int git_config_list_dup_entry(git_config_list *config_list, const git_config_ent
90
90
91
91
out :
92
92
if (error && duplicated ) {
93
- git__free ((char * ) duplicated -> base .name );
94
- git__free ((char * ) duplicated -> base .value );
93
+ git__free ((char * ) duplicated -> base .entry . name );
94
+ git__free ((char * ) duplicated -> base .entry . value );
95
95
git__free (duplicated );
96
96
}
97
97
return error ;
@@ -107,7 +107,7 @@ int git_config_list_dup(git_config_list **out, git_config_list *config_list)
107
107
goto out ;
108
108
109
109
for (head = config_list -> entries ; head ; head = head -> next )
110
- if ((git_config_list_dup_entry (result , & head -> entry -> base )) < 0 )
110
+ if ((git_config_list_dup_entry (result , & head -> entry -> base . entry )) < 0 )
111
111
goto out ;
112
112
113
113
* out = result ;
@@ -135,15 +135,15 @@ static void config_list_free(git_config_list *config_list)
135
135
git_strmap_free (config_list -> strings );
136
136
137
137
git_strmap_foreach_value (config_list -> map , head , {
138
- git__free ((char * ) head -> entry -> base .name );
138
+ git__free ((char * ) head -> entry -> base .entry . name );
139
139
git__free (head );
140
140
});
141
141
git_strmap_free (config_list -> map );
142
142
143
143
entry_list = config_list -> entries ;
144
144
while (entry_list != NULL ) {
145
145
next = entry_list -> next ;
146
- git__free ((char * ) entry_list -> entry -> base .value );
146
+ git__free ((char * ) entry_list -> entry -> base .entry . value );
147
147
git__free (entry_list -> entry );
148
148
git__free (entry_list );
149
149
entry_list = next ;
@@ -163,19 +163,19 @@ int git_config_list_append(git_config_list *config_list, git_config_list_entry *
163
163
config_entry_list * list_head ;
164
164
config_entry_map_head * map_head ;
165
165
166
- if ((map_head = git_strmap_get (config_list -> map , entry -> base .name )) != NULL ) {
166
+ if ((map_head = git_strmap_get (config_list -> map , entry -> base .entry . name )) != NULL ) {
167
167
map_head -> multivar = true;
168
168
/*
169
169
* This is a micro-optimization for configuration files
170
170
* with a lot of same keys. As for multivars the entry's
171
171
* key will be the same for all list, we can just free
172
172
* all except the first entry's name and just re-use it.
173
173
*/
174
- git__free ((char * ) entry -> base .name );
175
- entry -> base .name = map_head -> entry -> base .name ;
174
+ git__free ((char * ) entry -> base .entry . name );
175
+ entry -> base .entry . name = map_head -> entry -> base . entry .name ;
176
176
} else {
177
177
map_head = git__calloc (1 , sizeof (* map_head ));
178
- if ((git_strmap_set (config_list -> map , entry -> base .name , map_head )) < 0 )
178
+ if ((git_strmap_set (config_list -> map , entry -> base .entry . name , map_head )) < 0 )
179
179
return -1 ;
180
180
}
181
181
map_head -> entry = entry ;
@@ -216,7 +216,7 @@ int git_config_list_get_unique(git_config_list_entry **out, git_config_list *con
216
216
return -1 ;
217
217
}
218
218
219
- if (entry -> entry -> base .include_depth ) {
219
+ if (entry -> entry -> base .entry . include_depth ) {
220
220
git_error_set (GIT_ERROR_CONFIG , "entry is not unique due to being included" );
221
221
return -1 ;
222
222
}
@@ -233,7 +233,7 @@ static void config_iterator_free(git_config_iterator *iter)
233
233
}
234
234
235
235
static int config_iterator_next (
236
- git_config_entry * * entry ,
236
+ git_config_backend_entry * * entry ,
237
237
git_config_iterator * iter )
238
238
{
239
239
config_list_iterator * it = (config_list_iterator * ) iter ;
@@ -265,7 +265,7 @@ int git_config_list_iterator_new(git_config_iterator **out, git_config_list *con
265
265
}
266
266
267
267
/* release the map containing the entry as an equivalent to freeing it */
268
- void git_config_list_entry_free (git_config_entry * e )
268
+ void git_config_list_entry_free (git_config_backend_entry * e )
269
269
{
270
270
git_config_list_entry * entry = (git_config_list_entry * )e ;
271
271
git_config_list_free (entry -> config_list );
0 commit comments