builtins/commit: move commit modifier to auto-cleanup
This reduces the usage of goto cleanup logic by porting the commit modifier pointer to autoptr.
This commit is contained in:
parent
87db562744
commit
b079c11381
|
|
@ -432,7 +432,7 @@ ostree_builtin_commit (int argc, char **argv, OstreeCommandInvocation *invocatio
|
||||||
g_autoptr(GHashTable) skip_list = NULL;
|
g_autoptr(GHashTable) skip_list = NULL;
|
||||||
OstreeRepoCommitModifierFlags flags = 0;
|
OstreeRepoCommitModifierFlags flags = 0;
|
||||||
g_autoptr(OstreeSePolicy) policy = NULL;
|
g_autoptr(OstreeSePolicy) policy = NULL;
|
||||||
OstreeRepoCommitModifier *modifier = NULL;
|
g_autoptr(OstreeRepoCommitModifier) modifier = NULL;
|
||||||
OstreeRepoTransactionStats stats;
|
OstreeRepoTransactionStats stats;
|
||||||
struct CommitFilterData filter_data = { 0, };
|
struct CommitFilterData filter_data = { 0, };
|
||||||
g_autofree char *commit_body = NULL;
|
g_autofree char *commit_body = NULL;
|
||||||
|
|
@ -968,7 +968,5 @@ ostree_builtin_commit (int argc, char **argv, OstreeCommandInvocation *invocatio
|
||||||
out:
|
out:
|
||||||
if (repo)
|
if (repo)
|
||||||
ostree_repo_abort_transaction (repo, cancellable, NULL);
|
ostree_repo_abort_transaction (repo, cancellable, NULL);
|
||||||
if (modifier)
|
|
||||||
ostree_repo_commit_modifier_unref (modifier);
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue