Skip to content

Commit 14b3c34

Browse files
mhaggergitster
authored andcommitted
packed-backend.c: reorder some definitions
No code has been changed. This will make subsequent patches more self-contained. Signed-off-by: Michael Haggerty <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 81b9b5a commit 14b3c34

File tree

1 file changed

+24
-24
lines changed

1 file changed

+24
-24
lines changed

refs/packed-backend.c

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -36,30 +36,6 @@ struct packed_ref_cache {
3636
struct stat_validity validity;
3737
};
3838

39-
/*
40-
* Increment the reference count of *packed_refs.
41-
*/
42-
static void acquire_packed_ref_cache(struct packed_ref_cache *packed_refs)
43-
{
44-
packed_refs->referrers++;
45-
}
46-
47-
/*
48-
* Decrease the reference count of *packed_refs. If it goes to zero,
49-
* free *packed_refs and return true; otherwise return false.
50-
*/
51-
static int release_packed_ref_cache(struct packed_ref_cache *packed_refs)
52-
{
53-
if (!--packed_refs->referrers) {
54-
free_ref_cache(packed_refs->cache);
55-
stat_validity_clear(&packed_refs->validity);
56-
free(packed_refs);
57-
return 1;
58-
} else {
59-
return 0;
60-
}
61-
}
62-
6339
/*
6440
* A container for `packed-refs`-related data. It is not (yet) a
6541
* `ref_store`.
@@ -92,6 +68,30 @@ struct packed_ref_store {
9268
struct tempfile tempfile;
9369
};
9470

71+
/*
72+
* Increment the reference count of *packed_refs.
73+
*/
74+
static void acquire_packed_ref_cache(struct packed_ref_cache *packed_refs)
75+
{
76+
packed_refs->referrers++;
77+
}
78+
79+
/*
80+
* Decrease the reference count of *packed_refs. If it goes to zero,
81+
* free *packed_refs and return true; otherwise return false.
82+
*/
83+
static int release_packed_ref_cache(struct packed_ref_cache *packed_refs)
84+
{
85+
if (!--packed_refs->referrers) {
86+
free_ref_cache(packed_refs->cache);
87+
stat_validity_clear(&packed_refs->validity);
88+
free(packed_refs);
89+
return 1;
90+
} else {
91+
return 0;
92+
}
93+
}
94+
9595
struct ref_store *packed_ref_store_create(const char *path,
9696
unsigned int store_flags)
9797
{

0 commit comments

Comments
 (0)