From: Jonas Fonseca Date: Sat, 9 Apr 2011 18:19:56 +0000 (-0400) Subject: Use begin_update to load data in the tree and branch views X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=cea805b9dfaf077c3b799bbc38c5792c7fee49dd;p=tig.git Use begin_update to load data in the tree and branch views Deletes the now unused start_update. --- diff --git a/tig.c b/tig.c index f562218..ac053b3 100644 --- a/tig.c +++ b/tig.c @@ -2509,13 +2509,6 @@ prepare_update(struct view *view, const char *dir, const char *argv[]) return argv_copy(&view->argv, argv); } -static bool -start_update(struct view *view, const char **argv, const char *dir) -{ - return prepare_update(view, dir, argv) && - io_run(&view->io, IO_RD, dir, view->argv); -} - static bool begin_update(struct view *view, const char *dir, const char **argv, enum open_flags flags) { @@ -3730,11 +3723,10 @@ tree_read_date(struct view *view, char *text, bool *read_date) return TRUE; } else if (!text) { - char *path = *opt_path ? opt_path : "."; /* Find next entry to process */ const char *log_file[] = { "git", "log", "--no-color", "--pretty=raw", - "--cc", "--raw", view->id, "--", path, NULL + "--cc", "--raw", view->id, "--", "%(directory)", NULL }; if (!view->lines) { @@ -3743,7 +3735,7 @@ tree_read_date(struct view *view, char *text, bool *read_date) return TRUE; } - if (!start_update(view, log_file, opt_cdup)) { + if (!begin_update(view, opt_cdup, log_file, OPEN_EXTRA)) { report("Failed to load tree data"); return TRUE; } @@ -4681,12 +4673,11 @@ branch_open(struct view *view, enum open_flags flags) "--simplify-by-decoration", "--all", NULL }; - if (!start_update(view, branch_log, NULL)) { + if (!begin_update(view, NULL, branch_log, flags)) { report("Failed to load branch data"); return TRUE; } - setup_update(view, view->id); branch_open_visitor(view, &branch_all); foreach_ref(branch_open_visitor, view); view->p_restore = TRUE;