提交 f130b116 编写于 作者: M Michael Haggerty 提交者: Junio C Hamano

Extract a function clear_cached_refs()

Signed-off-by: NMichael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: NJunio C Hamano <gitster@pobox.com>
上级 b9176629
...@@ -171,10 +171,8 @@ static void free_ref_list(struct ref_list *list) ...@@ -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) if (ca->did_loose && ca->loose)
free_ref_list(ca->loose); free_ref_list(ca->loose);
if (ca->did_packed && ca->packed) if (ca->did_packed && ca->packed)
...@@ -183,6 +181,11 @@ static void invalidate_cached_refs(void) ...@@ -183,6 +181,11 @@ static void invalidate_cached_refs(void)
ca->did_loose = ca->did_packed = 0; 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) static void read_packed_refs(FILE *f, struct cached_refs *cached_refs)
{ {
struct ref_list *list = NULL; struct ref_list *list = NULL;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册