diff options
author | Michael Haggerty <mhagger@alum.mit.edu> | 2017-06-23 09:01:25 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-06-23 13:27:32 -0700 |
commit | 25e0c5faf2628e3701b1b9b783c3ca4a5653ec4d (patch) | |
tree | 51085c44871ab18d9257ec48500f3d6f3f797235 | |
parent | clear_packed_ref_cache(): take a `packed_ref_store *` parameter (diff) | |
download | tgif-25e0c5faf2628e3701b1b9b783c3ca4a5653ec4d.tar.xz |
validate_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>
-rw-r--r-- | refs/files-backend.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/refs/files-backend.c b/refs/files-backend.c index 2b0db60b2b..f061506bf0 100644 --- a/refs/files-backend.c +++ b/refs/files-backend.c @@ -396,12 +396,11 @@ static void files_ref_path(struct files_ref_store *refs, * Check that the packed refs cache (if any) still reflects the * contents of the file. If not, clear the cache. */ -static void validate_packed_ref_cache(struct files_ref_store *refs) +static void validate_packed_ref_cache(struct packed_ref_store *refs) { - if (refs->packed_ref_store->cache && - !stat_validity_check(&refs->packed_ref_store->cache->validity, - refs->packed_ref_store->path)) - clear_packed_ref_cache(refs->packed_ref_store); + if (refs->cache && + !stat_validity_check(&refs->cache->validity, refs->path)) + clear_packed_ref_cache(refs); } /* @@ -417,7 +416,7 @@ static struct packed_ref_cache *get_packed_ref_cache(struct files_ref_store *ref const char *packed_refs_file = refs->packed_ref_store->path; if (!is_lock_file_locked(&refs->packed_ref_store->lock)) - validate_packed_ref_cache(refs); + validate_packed_ref_cache(refs->packed_ref_store); if (!refs->packed_ref_store->cache) refs->packed_ref_store->cache = read_packed_refs(packed_refs_file); @@ -1364,7 +1363,7 @@ static int lock_packed_refs(struct files_ref_store *refs, int flags) * cache is still valid. We've just locked the file, but it * might have changed the moment *before* we locked it. */ - validate_packed_ref_cache(refs); + validate_packed_ref_cache(refs->packed_ref_store); packed_ref_cache = get_packed_ref_cache(refs); /* Increment the reference count to prevent it from being freed: */ |