pull: Ensure we begin a status line

Otherwise if the operation completes before anything happens, we hit
an assertion trying to end a status line when we didn't begin one.
This commit is contained in:
Colin Walters 2014-01-10 08:15:54 -05:00
parent 091523a3bd
commit ff2c592ac9
2 changed files with 8 additions and 2 deletions

View File

@ -110,7 +110,10 @@ ot_admin_builtin_upgrade (int argc, char **argv, OstreeSysroot *sysroot, GCancel
console = gs_console_get ();
if (console)
{
gs_console_begin_status_line (console, "", NULL, NULL);
progress = ostree_async_progress_new_and_connect (ot_common_pull_progress, console);
}
g_print ("Fetching remote %s ref %s\n", origin_remote, origin_ref);

View File

@ -66,7 +66,10 @@ ostree_builtin_pull (int argc, char **argv, OstreeRepo *repo, GCancellable *canc
console = gs_console_get ();
if (console)
{
gs_console_begin_status_line (console, "", NULL, NULL);
progress = ostree_async_progress_new_and_connect (ot_common_pull_progress, console);
}
if (!ostree_repo_pull (repo, remote, refs_to_fetch ? (char**)refs_to_fetch->pdata : NULL,
pullflags, progress, cancellable, error))