From 0e1214b9bf380cda0278f7535b39ac9177b148d5 Mon Sep 17 00:00:00 2001 From: Jonas Fonseca Date: Tue, 17 Nov 2009 22:43:28 -0500 Subject: [PATCH] begin_update: simplify control flow --- tig.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) 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] = { -- 2.30.2