summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: c3a7a07)
raw | patch | inline | side by side (parent: c3a7a07)
author | Jonas Fonseca <jonas.fonseca@savoirfairelinux.com> | |
Wed, 2 Jun 2010 16:10:20 +0000 (12:10 -0400) | ||
committer | Jonas Fonseca <fonseca@diku.dk> | |
Thu, 3 Jun 2010 01:15:51 +0000 (21:15 -0400) |
tig.c | patch | blob | history |
index 1bf95cda407dbcc43715223558e0c38fa20cdda3..86be4a2973615219fb321863eaa648e73210a8b6 100644 (file)
--- a/tig.c
+++ b/tig.c
@@ -753,14 +753,6 @@ io_prepare(struct io *io, const char *dir, enum io_type type, const char *argv[]
argv_copy(io->argv, argv, FALSE);
}
-static bool
-io_format(struct io *io, const char *dir, enum io_type type,
- const char *argv[], enum format_flags flags)
-{
- io_init(io, dir, type);
- return format_argv(io->argv, argv, flags);
-}
-
static bool
io_open(struct io *io, const char *fmt, ...)
{
view->start_time = time(NULL);
}
+static bool
+prepare_io(struct view *view, const char *dir, const char *argv[], bool replace)
+{
+ io_init(&view->io, dir, IO_RD);
+ return format_argv(view->io.argv, argv, replace ? FORMAT_ALL : FORMAT_NONE);
+}
+
static bool
prepare_update(struct view *view, const char *argv[], const char *dir)
{
if (view->pipe)
end_update(view, TRUE);
- return io_format(&view->io, dir, IO_RD, argv, FORMAT_NONE);
+ return prepare_io(view, dir, argv, FALSE);
}
static bool
{
if (view->pipe)
io_done(view->pipe);
- return io_format(&view->io, dir, IO_RD, argv, FORMAT_NONE) &&
+ return prepare_io(view, dir, argv, FALSE) &&
io_start(&view->io);
}
if (view->ops->prepare) {
if (!view->ops->prepare(view))
return FALSE;
- } else if (!io_format(&view->io, NULL, IO_RD, view->ops->argv, FORMAT_ALL)) {
+ } else if (!prepare_io(view, NULL, view->ops->argv, TRUE)) {
return FALSE;
}
opt_path[0] = 0;
}
- return io_format(&view->io, opt_cdup, IO_RD, view->ops->argv, FORMAT_ALL);
+ return prepare_io(view, opt_cdup, view->ops->argv, TRUE);
}
static const char *tree_argv[SIZEOF_ARG] = {