clear_packed_ref_cache(): take a `packed_ref_store *` parameter
It only cares about the packed-refs part of the reference store. Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Michael Haggerty committed
Jun 23, 2017 at 09:01 UTC
9c4fe0ff95a2d6245f6f0e52988d59f4131293b4
1 file changed
+8
-8
refs/files-backend.c
+8
-8
@@ -120,15 +120,15 @@ static int release_packed_ref_cache(struct packed_ref_cache *packed_refs)
120
}
121
}
122
123
-static void clear_packed_ref_cache(struct files_ref_store *refs)
123
+static void clear_packed_ref_cache(struct packed_ref_store *refs)
124
{
125
- if (refs->packed_ref_store->cache) {
126
- struct packed_ref_cache *packed_refs = refs->packed_ref_store->cache;
125
+ if (refs->cache) {
126
+ struct packed_ref_cache *cache = refs->cache;
127
128
- if (is_lock_file_locked(&refs->packed_ref_store->lock))
128
+ if (is_lock_file_locked(&refs->lock))
129
die("BUG: packed-ref cache cleared while locked");
130
- refs->packed_ref_store->cache = NULL;
131
- release_packed_ref_cache(packed_refs);
130
+ refs->cache = NULL;
131
+ release_packed_ref_cache(cache);
132
}
133
}
134
@@ -401,7 +401,7 @@ static void validate_packed_ref_cache(struct files_ref_store *refs)
401
if (refs->packed_ref_store->cache &&
402
!stat_validity_check(&refs->packed_ref_store->cache->validity,
403
refs->packed_ref_store->path))
404
- clear_packed_ref_cache(refs);
404
+ clear_packed_ref_cache(refs->packed_ref_store);
405
}
406
407
/*
@@ -1435,7 +1435,7 @@ static void rollback_packed_refs(struct files_ref_store *refs)
1435
die("BUG: packed-refs not locked");
1436
rollback_lock_file(&refs->packed_ref_store->lock);
1437
release_packed_ref_cache(packed_ref_cache);
1438
- clear_packed_ref_cache(refs);
1438
+ clear_packed_ref_cache(refs->packed_ref_store);
1439
}
1440
1441
struct ref_to_prune {