Skip to content

Commit

Permalink
Extract a function clear_cached_refs()
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Michael Haggerty authored and Junio C Hamano committed Aug 14, 2011
1 parent b917662 commit f130b11
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions refs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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;
Expand Down

0 comments on commit f130b11

Please sign in to comment.