diff options
author | Michael Haggerty <mhagger@alum.mit.edu> | 2012-05-20 08:49:32 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2012-05-20 15:10:49 -0700 |
commit | 27b5587c7610515832cf39cd0c3792e7655bdd9a (patch) | |
tree | 377bcb580ff840094360dff78711cc7f53a30d7b | |
parent | refs: fix find_containing_dir() regression (diff) | |
download | tgif-27b5587c7610515832cf39cd0c3792e7655bdd9a.tar.xz |
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 <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r-- | refs.c | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -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); } |