@@ -298,14 +298,14 @@ static struct ref_array *get_packed_refs(struct ref_cache *refs)
298
298
return & refs -> packed ;
299
299
}
300
300
301
- static void get_ref_dir (const char * submodule , const char * base ,
301
+ static void get_ref_dir (struct ref_cache * refs , const char * base ,
302
302
struct ref_array * array )
303
303
{
304
304
DIR * dir ;
305
305
const char * path ;
306
306
307
- if (* submodule )
308
- path = git_path_submodule (submodule , "%s" , base );
307
+ if (* refs -> name )
308
+ path = git_path_submodule (refs -> name , "%s" , base );
309
309
else
310
310
path = git_path ("%s" , base );
311
311
@@ -336,19 +336,19 @@ static void get_ref_dir(const char *submodule, const char *base,
336
336
if (has_extension (de -> d_name , ".lock" ))
337
337
continue ;
338
338
memcpy (refname + baselen , de -> d_name , namelen + 1 );
339
- refdir = submodule
340
- ? git_path_submodule (submodule , "%s" , refname )
339
+ refdir = * refs -> name
340
+ ? git_path_submodule (refs -> name , "%s" , refname )
341
341
: git_path ("%s" , refname );
342
342
if (stat (refdir , & st ) < 0 )
343
343
continue ;
344
344
if (S_ISDIR (st .st_mode )) {
345
- get_ref_dir (submodule , refname , array );
345
+ get_ref_dir (refs , refname , array );
346
346
continue ;
347
347
}
348
- if (submodule ) {
348
+ if (* refs -> name ) {
349
349
hashclr (sha1 );
350
350
flag = 0 ;
351
- if (resolve_gitlink_ref (submodule , refname , sha1 ) < 0 ) {
351
+ if (resolve_gitlink_ref (refs -> name , refname , sha1 ) < 0 ) {
352
352
hashclr (sha1 );
353
353
flag |= REF_ISBROKEN ;
354
354
}
@@ -400,7 +400,7 @@ void warn_dangling_symref(FILE *fp, const char *msg_fmt, const char *refname)
400
400
static struct ref_array * get_loose_refs (struct ref_cache * refs )
401
401
{
402
402
if (!refs -> did_loose ) {
403
- get_ref_dir (refs -> name , "refs" , & refs -> loose );
403
+ get_ref_dir (refs , "refs" , & refs -> loose );
404
404
sort_ref_array (& refs -> loose );
405
405
refs -> did_loose = 1 ;
406
406
}
0 commit comments