From: Jonas Fonseca Date: Wed, 18 Nov 2009 03:43:28 +0000 (-0500) Subject: begin_update: simplify control flow X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=0e1214b9bf380cda0278f7535b39ac9177b148d5;p=tig.git begin_update: simplify control flow --- diff --git a/tig.c b/tig.c index c4d2634..af8e196 100644 --- a/tig.c +++ b/tig.c @@ -2997,15 +2997,11 @@ begin_update(struct view *view, bool refresh) if (view->pipe) end_update(view, TRUE); - if (refresh) { - if (!start_io(&view->io)) - return FALSE; - - } else { + if (!refresh) { if (view->ops->prepare) { if (!view->ops->prepare(view)) return FALSE; - } else if (!run_io_rd(&view->io, view->ops->argv, FORMAT_ALL)) { + } else if (!init_io_rd(&view->io, view->ops->argv, NULL, FORMAT_ALL)) { return FALSE; } @@ -3016,6 +3012,9 @@ begin_update(struct view *view, bool refresh) string_copy_rev(view->ref, view->id); } + if (!start_io(&view->io)) + return FALSE; + setup_update(view, view->id); return TRUE; @@ -4545,7 +4544,7 @@ tree_prepare(struct view *view) opt_path[0] = 0; } - return run_io_rd_dir(&view->io, view->ops->argv, opt_cdup, FORMAT_ALL); + return init_io_rd(&view->io, view->ops->argv, opt_cdup, FORMAT_ALL); } static const char *tree_argv[SIZEOF_ARG] = {