Skip to content

Commit

Permalink
fixup! deployment: add ostree_deployment_get_version API
Browse files Browse the repository at this point in the history
Fix indentation + g_strdup can handle NULL
  • Loading branch information
r4f4 committed Dec 20, 2019
1 parent 8219c88 commit 2dd8418
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/libostree/ostree-deployment.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ _ostree_deployment_get_version (OstreeDeployment *self,
gchar *version = NULL;
g_autoptr(GVariant) variant = NULL;
if (ostree_repo_load_variant (repo, OSTREE_OBJECT_TYPE_COMMIT, csum,
&variant, error))
&variant, error))
{
g_autoptr(GVariant) metadata = g_variant_get_child_value (variant, 0);
g_variant_lookup (metadata, OSTREE_COMMIT_META_KEY_VERSION, "s", &version);
Expand Down Expand Up @@ -199,8 +199,7 @@ ostree_deployment_clone (OstreeDeployment *self)
self->deployserial,
self->bootcsum, self->bootserial);

if (self->version)
ret->version = g_strdup (self->version);
ret->version = g_strdup (self->version);

new_bootconfig = ostree_bootconfig_parser_clone (self->bootconfig);
ostree_deployment_set_bootconfig (ret, new_bootconfig);
Expand Down

0 comments on commit 2dd8418

Please sign in to comment.