Skip to content

Commit

Permalink
fixup! OstreeMutableTree: Refactor: Add parent pointer
Browse files Browse the repository at this point in the history
  • Loading branch information
wmanley committed Jun 27, 2018
1 parent 3c091e4 commit 462d7c5
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/libostree/ostree-mutable-tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ insert_child_mtree (OstreeMutableTree *self, const gchar* name,
g_assert_null (child->parent);
g_hash_table_insert (self->subdirs, g_strdup (name), child);
child->parent = self;
invalidate_contents_checksum (self);
}

static void
Expand Down Expand Up @@ -146,7 +147,7 @@ invalidate_contents_checksum (OstreeMutableTree *self)
break;

g_free (self->contents_checksum);
self->contents_checksum = NULL;
g_clear_pointer (self->contents_checksum, g_free);
self = self->parent;
}
}
Expand Down Expand Up @@ -265,7 +266,6 @@ ostree_mutable_tree_ensure_dir (OstreeMutableTree *self,
if (!ret_dir)
{
ret_dir = ostree_mutable_tree_new ();
invalidate_contents_checksum (self);
insert_child_mtree (self, name, g_object_ref (ret_dir));
}

Expand Down Expand Up @@ -347,7 +347,6 @@ ostree_mutable_tree_ensure_parent_dirs (OstreeMutableTree *self,
next = g_hash_table_lookup (subdir->subdirs, name);
if (!next)
{
invalidate_contents_checksum (subdir);
next = ostree_mutable_tree_new ();
ostree_mutable_tree_set_metadata_checksum (next, metadata_checksum);
insert_child_mtree (subdir, g_strdup (name), next);
Expand Down

0 comments on commit 462d7c5

Please sign in to comment.