summaryrefslogtreecommitdiff
path: root/refs/ref-cache.h
diff options
context:
space:
mode:
authorMichael Haggerty <mhagger@alum.mit.edu>2017-05-22 14:17:50 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-05-23 05:29:55 (GMT)
commit099a912a279415dd27716ee5de07ff347bfc49da (patch)
treed5c4bff50ad6faf92850d84076a7c51a3880fc3d /refs/ref-cache.h
parent28ed9830b1dc65df37bdb3c9b8ef743f1f266262 (diff)
downloadgit-099a912a279415dd27716ee5de07ff347bfc49da.zip
git-099a912a279415dd27716ee5de07ff347bfc49da.tar.gz
git-099a912a279415dd27716ee5de07ff347bfc49da.tar.bz2
read_packed_refs(): do more of the work of reading packed refs
Teach `read_packed_refs()` to also * Allocate and initialize the new `packed_ref_cache` * Open and close the `packed-refs` file * Update the `validity` field of the new object This decreases the coupling between `packed_refs_cache` and `files_ref_store` by a little bit. Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'refs/ref-cache.h')
-rw-r--r--refs/ref-cache.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/refs/ref-cache.h b/refs/ref-cache.h
index 1f65e2f..fbfee7c 100644
--- a/refs/ref-cache.h
+++ b/refs/ref-cache.h
@@ -194,7 +194,8 @@ struct ref_entry *create_ref_entry(const char *refname,
* function called to fill in incomplete directories in the
* `ref_cache` when they are accessed. If it is NULL, then the whole
* `ref_cache` must be filled (including clearing its directories'
- * `REF_INCOMPLETE` bits) before it is used.
+ * `REF_INCOMPLETE` bits) before it is used, and `refs` can be NULL,
+ * too.
*/
struct ref_cache *create_ref_cache(struct ref_store *refs,
fill_ref_dir_fn *fill_ref_dir);