Skip to content

Commit a714b19

Browse files
mhaggergitster
authored andcommitted
get_loose_ref_cache(): new function
Extract a new function, `get_loose_ref_cache()`, from get_loose_ref_dir(). The function returns the `ref_cache` for the loose refs of a `files_ref_store`. Signed-off-by: Michael Haggerty <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 86f4235 commit a714b19

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

refs/files-backend.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -524,7 +524,7 @@ static void loose_fill_ref_dir(struct ref_store *ref_store,
524524
}
525525
}
526526

527-
static struct ref_dir *get_loose_ref_dir(struct files_ref_store *refs)
527+
static struct ref_cache *get_loose_ref_cache(struct files_ref_store *refs)
528528
{
529529
if (!refs->loose) {
530530
/*
@@ -544,7 +544,12 @@ static struct ref_dir *get_loose_ref_dir(struct files_ref_store *refs)
544544
add_entry_to_dir(get_ref_dir(refs->loose->root),
545545
create_dir_entry(refs->loose, "refs/", 5, 1));
546546
}
547-
return get_ref_dir(refs->loose->root);
547+
return refs->loose;
548+
}
549+
550+
static struct ref_dir *get_loose_ref_dir(struct files_ref_store *refs)
551+
{
552+
return get_ref_dir(get_loose_ref_cache(refs)->root);
548553
}
549554

550555
/*

0 commit comments

Comments
 (0)