summaryrefslogtreecommitdiff
path: root/refs
diff options
context:
space:
mode:
authorMichael Haggerty <mhagger@alum.mit.edu>2017-09-25 08:00:09 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-09-25 09:02:45 (GMT)
commit14b3c344ead04deb7ff9680cd8cf927f9f9ac12a (patch)
tree43a32ba5a8b00d1280c9860ef8deded916ac6f66 /refs
parent81b9b5aea7094cdef110c4ae91d9cc601510fe8b (diff)
downloadgit-14b3c344ead04deb7ff9680cd8cf927f9f9ac12a.zip
git-14b3c344ead04deb7ff9680cd8cf927f9f9ac12a.tar.gz
git-14b3c344ead04deb7ff9680cd8cf927f9f9ac12a.tar.bz2
packed-backend.c: reorder some definitions
No code has been changed. This will make subsequent patches more self-contained. 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/packed-backend.c48
1 files changed, 24 insertions, 24 deletions
diff --git a/refs/packed-backend.c b/refs/packed-backend.c
index 724c886..0fe41a7 100644
--- a/refs/packed-backend.c
+++ b/refs/packed-backend.c
@@ -37,30 +37,6 @@ struct packed_ref_cache {
};
/*
- * Increment the reference count of *packed_refs.
- */
-static void acquire_packed_ref_cache(struct packed_ref_cache *packed_refs)
-{
- packed_refs->referrers++;
-}
-
-/*
- * Decrease the reference count of *packed_refs. If it goes to zero,
- * free *packed_refs and return true; otherwise return false.
- */
-static int release_packed_ref_cache(struct packed_ref_cache *packed_refs)
-{
- if (!--packed_refs->referrers) {
- free_ref_cache(packed_refs->cache);
- stat_validity_clear(&packed_refs->validity);
- free(packed_refs);
- return 1;
- } else {
- return 0;
- }
-}
-
-/*
* A container for `packed-refs`-related data. It is not (yet) a
* `ref_store`.
*/
@@ -92,6 +68,30 @@ struct packed_ref_store {
struct tempfile tempfile;
};
+/*
+ * Increment the reference count of *packed_refs.
+ */
+static void acquire_packed_ref_cache(struct packed_ref_cache *packed_refs)
+{
+ packed_refs->referrers++;
+}
+
+/*
+ * Decrease the reference count of *packed_refs. If it goes to zero,
+ * free *packed_refs and return true; otherwise return false.
+ */
+static int release_packed_ref_cache(struct packed_ref_cache *packed_refs)
+{
+ if (!--packed_refs->referrers) {
+ free_ref_cache(packed_refs->cache);
+ stat_validity_clear(&packed_refs->validity);
+ free(packed_refs);
+ return 1;
+ } else {
+ return 0;
+ }
+}
+
struct ref_store *packed_ref_store_create(const char *path,
unsigned int store_flags)
{