@@ -134,15 +134,15 @@ static struct ref_entry *search_ref_array(struct ref_array *array, const char *n
134
134
* Future: need to be in "struct repository"
135
135
* when doing a full libification.
136
136
*/
137
- static struct cached_refs {
138
- struct cached_refs * next ;
137
+ static struct ref_cache {
138
+ struct ref_cache * next ;
139
139
char did_loose ;
140
140
char did_packed ;
141
141
struct ref_array loose ;
142
142
struct ref_array packed ;
143
143
/* The submodule name, or "" for the main repo. */
144
144
char name [FLEX_ARRAY ];
145
- } * cached_refs ;
145
+ } * ref_cache ;
146
146
147
147
static struct ref_entry * current_ref ;
148
148
@@ -158,7 +158,7 @@ static void free_ref_array(struct ref_array *array)
158
158
array -> refs = NULL ;
159
159
}
160
160
161
- static void clear_cached_refs (struct cached_refs * ca )
161
+ static void clear_ref_cache (struct ref_cache * ca )
162
162
{
163
163
if (ca -> did_loose )
164
164
free_ref_array (& ca -> loose );
@@ -167,27 +167,27 @@ static void clear_cached_refs(struct cached_refs *ca)
167
167
ca -> did_loose = ca -> did_packed = 0 ;
168
168
}
169
169
170
- static struct cached_refs * create_cached_refs (const char * submodule )
170
+ static struct ref_cache * create_ref_cache (const char * submodule )
171
171
{
172
172
int len ;
173
- struct cached_refs * refs ;
173
+ struct ref_cache * refs ;
174
174
if (!submodule )
175
175
submodule = "" ;
176
176
len = strlen (submodule ) + 1 ;
177
- refs = xcalloc (1 , sizeof (struct cached_refs ) + len );
177
+ refs = xcalloc (1 , sizeof (struct ref_cache ) + len );
178
178
memcpy (refs -> name , submodule , len );
179
179
return refs ;
180
180
}
181
181
182
182
/*
183
- * Return a pointer to a cached_refs for the specified submodule. For
183
+ * Return a pointer to a ref_cache for the specified submodule. For
184
184
* the main repository, use submodule==NULL. The returned structure
185
185
* will be allocated and initialized but not necessarily populated; it
186
186
* should not be freed.
187
187
*/
188
- static struct cached_refs * get_cached_refs (const char * submodule )
188
+ static struct ref_cache * get_ref_cache (const char * submodule )
189
189
{
190
- struct cached_refs * refs = cached_refs ;
190
+ struct ref_cache * refs = ref_cache ;
191
191
if (!submodule )
192
192
submodule = "" ;
193
193
while (refs ) {
@@ -196,17 +196,17 @@ static struct cached_refs *get_cached_refs(const char *submodule)
196
196
refs = refs -> next ;
197
197
}
198
198
199
- refs = create_cached_refs (submodule );
200
- refs -> next = cached_refs ;
201
- cached_refs = refs ;
199
+ refs = create_ref_cache (submodule );
200
+ refs -> next = ref_cache ;
201
+ ref_cache = refs ;
202
202
return refs ;
203
203
}
204
204
205
- static void invalidate_cached_refs (void )
205
+ static void invalidate_ref_cache (void )
206
206
{
207
- struct cached_refs * refs = cached_refs ;
207
+ struct ref_cache * refs = ref_cache ;
208
208
while (refs ) {
209
- clear_cached_refs (refs );
209
+ clear_ref_cache (refs );
210
210
refs = refs -> next ;
211
211
}
212
212
}
@@ -257,7 +257,7 @@ void clear_extra_refs(void)
257
257
258
258
static struct ref_array * get_packed_refs (const char * submodule )
259
259
{
260
- struct cached_refs * refs = get_cached_refs (submodule );
260
+ struct ref_cache * refs = get_ref_cache (submodule );
261
261
262
262
if (!refs -> did_packed ) {
263
263
const char * packed_refs_file ;
@@ -379,7 +379,7 @@ void warn_dangling_symref(FILE *fp, const char *msg_fmt, const char *refname)
379
379
380
380
static struct ref_array * get_loose_refs (const char * submodule )
381
381
{
382
- struct cached_refs * refs = get_cached_refs (submodule );
382
+ struct ref_cache * refs = get_ref_cache (submodule );
383
383
384
384
if (!refs -> did_loose ) {
385
385
get_ref_dir (submodule , "refs" , & refs -> loose );
@@ -1228,7 +1228,7 @@ int delete_ref(const char *refname, const unsigned char *sha1, int delopt)
1228
1228
ret |= repack_without_ref (refname );
1229
1229
1230
1230
unlink_or_warn (git_path ("logs/%s" , lock -> ref_name ));
1231
- invalidate_cached_refs ();
1231
+ invalidate_ref_cache ();
1232
1232
unlock_ref (lock );
1233
1233
return ret ;
1234
1234
}
@@ -1527,7 +1527,7 @@ int write_ref_sha1(struct ref_lock *lock,
1527
1527
unlock_ref (lock );
1528
1528
return -1 ;
1529
1529
}
1530
- invalidate_cached_refs ();
1530
+ invalidate_ref_cache ();
1531
1531
if (log_ref_write (lock -> ref_name , lock -> old_sha1 , sha1 , logmsg ) < 0 ||
1532
1532
(strcmp (lock -> ref_name , lock -> orig_ref_name ) &&
1533
1533
log_ref_write (lock -> orig_ref_name , lock -> old_sha1 , sha1 , logmsg ) < 0 )) {
0 commit comments