diff options
author | Michael Haggerty <mhagger@alum.mit.edu> | 2017-04-16 09:41:38 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-04-17 07:32:46 +0300 |
commit | a714b19ca81607e53ddbde41eb9082b435148e73 (patch) | |
tree | 7db395466581293bd83db62fe7d2f0ed0ac81efc /refs | |
parent | 86f423584bd2332580de8baa19d6b661bb3d330c (diff) |
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 <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'refs')
-rw-r--r-- | refs/files-backend.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/refs/files-backend.c b/refs/files-backend.c index 3beab0b752..7ae7c6a1b7 100644 --- a/refs/files-backend.c +++ b/refs/files-backend.c @@ -524,7 +524,7 @@ static void loose_fill_ref_dir(struct ref_store *ref_store, } } -static struct ref_dir *get_loose_ref_dir(struct files_ref_store *refs) +static struct ref_cache *get_loose_ref_cache(struct files_ref_store *refs) { if (!refs->loose) { /* @@ -544,7 +544,12 @@ static struct ref_dir *get_loose_ref_dir(struct files_ref_store *refs) add_entry_to_dir(get_ref_dir(refs->loose->root), create_dir_entry(refs->loose, "refs/", 5, 1)); } - return get_ref_dir(refs->loose->root); + return refs->loose; +} + +static struct ref_dir *get_loose_ref_dir(struct files_ref_store *refs) +{ + return get_ref_dir(get_loose_ref_cache(refs)->root); } /* |