Skip to content

Commit 9c4fe0f

Browse files
mhaggergitster
authored andcommitted
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>
1 parent 139c459 commit 9c4fe0f

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

refs/files-backend.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -120,15 +120,15 @@ static int release_packed_ref_cache(struct packed_ref_cache *packed_refs)
120120
}
121121
}
122122

123-
static void clear_packed_ref_cache(struct files_ref_store *refs)
123+
static void clear_packed_ref_cache(struct packed_ref_store *refs)
124124
{
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;
127127

128-
if (is_lock_file_locked(&refs->packed_ref_store->lock))
128+
if (is_lock_file_locked(&refs->lock))
129129
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);
132132
}
133133
}
134134

@@ -401,7 +401,7 @@ static void validate_packed_ref_cache(struct files_ref_store *refs)
401401
if (refs->packed_ref_store->cache &&
402402
!stat_validity_check(&refs->packed_ref_store->cache->validity,
403403
refs->packed_ref_store->path))
404-
clear_packed_ref_cache(refs);
404+
clear_packed_ref_cache(refs->packed_ref_store);
405405
}
406406

407407
/*
@@ -1435,7 +1435,7 @@ static void rollback_packed_refs(struct files_ref_store *refs)
14351435
die("BUG: packed-refs not locked");
14361436
rollback_lock_file(&refs->packed_ref_store->lock);
14371437
release_packed_ref_cache(packed_ref_cache);
1438-
clear_packed_ref_cache(refs);
1438+
clear_packed_ref_cache(refs->packed_ref_store);
14391439
}
14401440

14411441
struct ref_to_prune {

0 commit comments

Comments
 (0)