From: Michael Haggerty Date: Sun, 20 May 2012 06:49:32 +0000 (+0200) Subject: free_ref_entry(): do not trigger reading of loose refs X-Git-Tag: v1.7.11-rc1~19^2 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=27b5587c7610515832cf39cd0c3792e7655bdd9a;p=git.git free_ref_entry(): do not trigger reading of loose refs Do not call get_ref_dir() from within free_ref_entry(), because that triggers the reading of loose refs, only for them to be freed immediately. Signed-off-by: Michael Haggerty Signed-off-by: Junio C Hamano --- diff --git a/refs.c b/refs.c index af5da5f1c..c9f48735f 100644 --- a/refs.c +++ b/refs.c @@ -259,8 +259,13 @@ static void clear_ref_dir(struct ref_dir *dir); static void free_ref_entry(struct ref_entry *entry) { - if (entry->flag & REF_DIR) - clear_ref_dir(get_ref_dir(entry)); + if (entry->flag & REF_DIR) { + /* + * Do not use get_ref_dir() here, as that might + * trigger the reading of loose refs. + */ + clear_ref_dir(&entry->u.subdir); + } free(entry); }