fsck: De-indent loop

Could have done this in the previous change, but wanted to avoid
excessive diff noise.
This commit is contained in:
Colin Walters 2022-06-12 10:48:39 -04:00
parent e6ad897850
commit 2fe0ea7395
1 changed files with 83 additions and 93 deletions

View File

@ -314,24 +314,19 @@ ostree_builtin_fsck (int argc, char **argv, OstreeCommandInvocation *invocation,
g_assert (objtype == OSTREE_OBJECT_TYPE_COMMIT);
if (TRUE) // Temporarily avoiding the noise of de-indenting this whole thing
{
if (!ostree_repo_load_commit (repo, checksum, &commit, &commitstate, error))
return FALSE;
/* If requested, check that all the refs listed in the ref-bindings
* for this commit resolve back to this commit. */
if (opt_verify_back_refs)
{
g_autoptr(GVariant) metadata = g_variant_get_child_value (commit, 0);
const char *collection_id = NULL;
if (!g_variant_lookup (metadata,
OSTREE_COMMIT_META_KEY_COLLECTION_BINDING,
"&s",
&collection_id))
collection_id = NULL;
g_autofree const char **refs = NULL;
if (g_variant_lookup (metadata,
OSTREE_COMMIT_META_KEY_REF_BINDING,
@ -341,7 +336,6 @@ ostree_builtin_fsck (int argc, char **argv, OstreeCommandInvocation *invocation,
for (const char **iter = refs; *iter != NULL; ++iter)
{
g_autofree char *checksum_for_ref = NULL;
if (collection_id != NULL)
{
const OstreeCollectionRef collection_ref = { (char *) collection_id, (char *) *iter };
@ -359,7 +353,6 @@ ostree_builtin_fsck (int argc, char **argv, OstreeCommandInvocation *invocation,
&checksum_for_ref, error))
return FALSE;
}
if (checksum_for_ref == NULL)
{
if (collection_id != NULL)
@ -385,7 +378,6 @@ ostree_builtin_fsck (int argc, char **argv, OstreeCommandInvocation *invocation,
}
}
}
if (opt_add_tombstones)
{
GError *local_error = NULL;
@ -409,7 +401,6 @@ ostree_builtin_fsck (int argc, char **argv, OstreeCommandInvocation *invocation,
}
}
}
if (commitstate & OSTREE_REPO_COMMIT_STATE_PARTIAL)
{
n_partial++;
@ -419,7 +410,6 @@ ostree_builtin_fsck (int argc, char **argv, OstreeCommandInvocation *invocation,
else
g_hash_table_add (commits, g_variant_ref (serialized_key));
}
}
g_clear_pointer (&all_commits, g_hash_table_unref);