core: Allow specifying a previous commit tree as a basis for a new commit

It's pretty trivial to map a previously existing commit tree into a
mutable tree too.  While we're here change the command line arguments
for commit so that we can now properly overlay any combination of
directory, commit, or tarfile.
This commit is contained in:
Colin Walters committed 2011-12-21 20:10:10 -05:00
1 parent c8377c7c5c
commit add55849ab
6 files changed
+146 -61

No files matched your search

+16
View File
@@ -28,6 +28,7 @@ struct _OstreeMutableTree
{
GObject parent_instance;
char *contents_checksum;
char *metadata_checksum;
GHashTable *files;
@@ -43,6 +44,7 @@ ostree_mutable_tree_finalize (GObject *object)
self = OSTREE_MUTABLE_TREE (object);
g_free (self->contents_checksum);
g_free (self->metadata_checksum);
g_hash_table_destroy (self->files);
@@ -82,6 +84,20 @@ ostree_mutable_tree_get_metadata_checksum (OstreeMutableTree *self)
return self->metadata_checksum;
}
void
ostree_mutable_tree_set_contents_checksum (OstreeMutableTree *self,
const char *checksum)
{
g_free (self->contents_checksum);
self->contents_checksum = g_strdup (checksum);
}
const char *
ostree_mutable_tree_get_contents_checksum (OstreeMutableTree *self)
{
return self->contents_checksum;
}
static gboolean
set_error_noent (GError **error, const char *path)
{