summaryrefslogtreecommitdiff
path: root/refs.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2012-05-29 20:08:35 (GMT)
committerJunio C Hamano <gitster@pobox.com>2012-05-29 20:08:35 (GMT)
commit38f2b874ff0e7d6f182b7995d45efbaf1adfe94a (patch)
tree001ef8644b83dc2d1d55c6e8b8a0c6c3da315fdb /refs.c
parent32bd3a514b38d2c1ecbe84a0475374559e549ebb (diff)
parent27b5587c7610515832cf39cd0c3792e7655bdd9a (diff)
downloadgit-38f2b874ff0e7d6f182b7995d45efbaf1adfe94a.zip
git-38f2b874ff0e7d6f182b7995d45efbaf1adfe94a.tar.gz
git-38f2b874ff0e7d6f182b7995d45efbaf1adfe94a.tar.bz2
Merge branch 'mh/ref-api-lazy-loose'
The code to lazily read loose refs unnecessarily read the refs in a subhierarchy by mistake when we free the data for the subhierarchy. By Michael Haggerty * mh/ref-api-lazy-loose: free_ref_entry(): do not trigger reading of loose refs
Diffstat (limited to 'refs.c')
-rw-r--r--refs.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/refs.c b/refs.c
index 010ed07..51c8825 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);
}