From: Michael Haggerty Date: Fri, 12 Aug 2011 22:36:24 +0000 (+0200) Subject: Extract a function clear_cached_refs() X-Git-Tag: v1.7.8-rc0~108^2~6 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=f130b1168e95f51dcd6c7f3667b14bd244a9c61e;p=git.git Extract a function clear_cached_refs() Signed-off-by: Michael Haggerty Signed-off-by: Junio C Hamano --- diff --git a/refs.c b/refs.c index 3a8789d38..9dc25c398 100644 --- a/refs.c +++ b/refs.c @@ -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;