diff options
author | Michael Haggerty <mhagger@alum.mit.edu> | 2011-08-13 00:36:24 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2011-08-14 15:18:51 -0700 |
commit | f130b1168e95f51dcd6c7f3667b14bd244a9c61e (patch) | |
tree | 5f55e6860e3b55481b7a6128ff315d91904aec21 /refs.c | |
parent | b91766295f2b873bbd4ef79c06de05aff27f8e12 (diff) | |
download | git-f130b1168e95f51dcd6c7f3667b14bd244a9c61e.tar.gz |
Extract a function clear_cached_refs()
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'refs.c')
-rw-r--r-- | refs.c | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -171,10 +171,8 @@ static void free_ref_list(struct ref_list *list) } } -static void invalidate_cached_refs(void) +static void clear_cached_refs(struct cached_refs *ca) { - struct cached_refs *ca = &cached_refs; - if (ca->did_loose && ca->loose) free_ref_list(ca->loose); if (ca->did_packed && ca->packed) @@ -183,6 +181,11 @@ static void invalidate_cached_refs(void) ca->did_loose = ca->did_packed = 0; } +static void invalidate_cached_refs(void) +{ + clear_cached_refs(&cached_refs); +} + static void read_packed_refs(FILE *f, struct cached_refs *cached_refs) { struct ref_list *list = NULL; |