Code

Use begin_update to load data in the tree and branch views
authorJonas Fonseca <fonseca@diku.dk>
Sat, 9 Apr 2011 18:19:56 +0000 (14:19 -0400)
committerJonas Fonseca <fonseca@diku.dk>
Sat, 9 Apr 2011 18:20:40 +0000 (14:20 -0400)
Deletes the now unused start_update.

tig.c

diff --git a/tig.c b/tig.c
index f562218376a5f17edc4722ce7e2fb25b4b985ec5..ac053b3510349b777f604a6bf13cb63d986387de 100644 (file)
--- 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;