Merge pull request #2150 from cgwalters/pull-append-written
pull: Also append bytes written
This commit is contained in:
commit
d5968f2cb2
|
|
@ -3358,6 +3358,7 @@ ostree_repo_pull_with_options (OstreeRepo *self,
|
||||||
* value, otherwise NULL. Used for logging.
|
* value, otherwise NULL. Used for logging.
|
||||||
*/
|
*/
|
||||||
const char *the_ref_to_fetch = NULL;
|
const char *the_ref_to_fetch = NULL;
|
||||||
|
OstreeRepoTransactionStats tstats = { 0, };
|
||||||
|
|
||||||
/* Default */
|
/* Default */
|
||||||
pull_data->max_metadata_size = OSTREE_MAX_METADATA_SIZE;
|
pull_data->max_metadata_size = OSTREE_MAX_METADATA_SIZE;
|
||||||
|
|
@ -4444,7 +4445,7 @@ ostree_repo_pull_with_options (OstreeRepo *self,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!inherit_transaction &&
|
if (!inherit_transaction &&
|
||||||
!ostree_repo_commit_transaction (pull_data->repo, NULL, cancellable, error))
|
!ostree_repo_commit_transaction (pull_data->repo, &tstats, cancellable, error))
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
end_time = g_get_monotonic_time ();
|
end_time = g_get_monotonic_time ();
|
||||||
|
|
@ -4486,6 +4487,11 @@ ostree_repo_pull_with_options (OstreeRepo *self,
|
||||||
shift == 1 ? "B" : "KiB",
|
shift == 1 ? "B" : "KiB",
|
||||||
(guint) ((end_time - pull_data->start_time) / G_USEC_PER_SEC));
|
(guint) ((end_time - pull_data->start_time) / G_USEC_PER_SEC));
|
||||||
}
|
}
|
||||||
|
if (!inherit_transaction)
|
||||||
|
{
|
||||||
|
g_autofree char *bytes_written = g_format_size (tstats.content_bytes_written);
|
||||||
|
g_string_append_printf (buf, "; %s content written", bytes_written);
|
||||||
|
}
|
||||||
|
|
||||||
ostree_async_progress_set_status (pull_data->progress, buf->str);
|
ostree_async_progress_set_status (pull_data->progress, buf->str);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -64,7 +64,7 @@ fi
|
||||||
# Try both syntaxes
|
# Try both syntaxes
|
||||||
repo_init --no-sign-verify
|
repo_init --no-sign-verify
|
||||||
${CMD_PREFIX} ostree --repo=repo pull origin main >out.txt
|
${CMD_PREFIX} ostree --repo=repo pull origin main >out.txt
|
||||||
assert_file_has_content out.txt "[1-9][0-9]* metadata, [1-9][0-9]* content objects fetched"
|
assert_file_has_content out.txt "[1-9][0-9]* metadata, [1-9][0-9]* content objects fetched; [1-9][0-9]*.*written"
|
||||||
${CMD_PREFIX} ostree --repo=repo pull origin:main > out.txt
|
${CMD_PREFIX} ostree --repo=repo pull origin:main > out.txt
|
||||||
assert_not_file_has_content out.txt "[1-9][0-9]* content objects fetched"
|
assert_not_file_has_content out.txt "[1-9][0-9]* content objects fetched"
|
||||||
${CMD_PREFIX} ostree --repo=repo fsck
|
${CMD_PREFIX} ostree --repo=repo fsck
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue