OstreeMutableTree: Invalidate parent contents checksum when metadata changes

This bug has existed before the previous commit, but thanks to the previous
commit it is now easy to fix.

Closes: #1655
Approved by: cgwalters
This commit is contained in:
William Manley authored and Atomic Bot committed 2018-06-29 21:31:08 +00:00
1 parent 5b0dd1002e
commit 488365f9bf
2 files changed
+27 -3

No files matched your search

+4 -1
View File
@@ -148,7 +148,6 @@ invalidate_contents_checksum (OstreeMutableTree *self)
if (!self->contents_checksum)
break;
g_free (self->contents_checksum);
g_clear_pointer (&self->contents_checksum, g_free);
self = self->parent;
}
@@ -158,6 +157,10 @@ void
ostree_mutable_tree_set_metadata_checksum (OstreeMutableTree *self,
const char *checksum)
{
if (g_strcmp0 (checksum, self->metadata_checksum) == 0)
return;
invalidate_contents_checksum (self->parent);
g_free (self->metadata_checksum);
self->metadata_checksum = g_strdup (checksum);
}