fsck: Only print "marking commit partial" once

Let's only print if the commit isn't already partial; this
addresses a spam of "marking commit partial" from fsck.

Closes: #1548
Approved by: cgwalters
This commit is contained in:
Colin Walters authored and Atomic Bot committed 2018-04-23 17:23:40 +00:00
1 parent 6d01d82b9b
commit 41b97e9c12
3 files changed
+14 -6

No files matched your search

+9 -2
View File
@@ -99,9 +99,16 @@ fsck_one_object (OstreeRepo *repo,
for (i = 0; parent_commits[i] != NULL; i++)
{
const char *parent_commit = parent_commits[i];
g_printerr ("Marking commit %s as partial\n", parent_commit);
if (!ostree_repo_mark_commit_partial (repo, parent_commit, TRUE, error))
OstreeRepoCommitState state;
if (!ostree_repo_load_commit (repo, parent_commit, NULL,
&state, error))
return FALSE;
if ((state & OSTREE_REPO_COMMIT_STATE_PARTIAL) == 0)
{
g_printerr ("Marking commit as partial: %s\n", parent_commit);
if (!ostree_repo_mark_commit_partial (repo, parent_commit, TRUE, error))
return FALSE;
}
}
}
}