summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: e63f5aa)
raw | patch | inline | side by side (parent: e63f5aa)
author | Jonas Fonseca <fonseca@diku.dk> | |
Wed, 23 Jun 2010 02:52:58 +0000 (22:52 -0400) | ||
committer | Jonas Fonseca <fonseca@diku.dk> | |
Wed, 23 Jun 2010 02:55:34 +0000 (22:55 -0400) |
This can happen if a file spec was passed on the command line and
the diff view is opened from the blame view with a different path.
the diff view is opened from the blame view with a different path.
NEWS | patch | blob | history | |
tig.c | patch | blob | history |
index af9312d22929a815a9cabb6aee155b6170db9f4d..41729f7f13dd4fd4f503ae969d3b0d0915f20315 100644 (file)
--- a/NEWS
+++ b/NEWS
Release notes
=============
+tig master
+----------
+
+Bug fixes:
+
+ - Fix problem with empty diff views when file specs were passed on the
+ command line.
+
tig-0.16
--------
index e2e83ff8fb320acb494796479f5288eb7e5d6e71..5f4c2635c3a719c5ea06d01bc08be62b042802a5 100644 (file)
--- a/tig.c
+++ b/tig.c
"%(diffargs)", "%(commit)", "--", "%(fileargs)", NULL
};
+static bool
+diff_read(struct view *view, char *data)
+{
+ if (!data) {
+ /* Fall back to retry if no diff will be shown. */
+ if (view->lines == 0 && opt_file_args) {
+ int pos = argv_size(view->argv)
+ - argv_size(opt_file_args) - 1;
+
+ if (pos > 0 && !strcmp(view->argv[pos], "--")) {
+ for (; view->argv[pos]; pos++) {
+ free((void *) view->argv[pos]);
+ view->argv[pos] = NULL;
+ }
+
+ if (view->pipe)
+ io_done(view->pipe);
+ if (io_run(&view->io, IO_RD, view->dir, view->argv))
+ return FALSE;
+ }
+ }
+ return TRUE;
+ }
+
+ return pager_read(view, data);
+}
+
static struct view_ops diff_ops = {
"line",
diff_argv,
NULL,
- pager_read,
+ diff_read,
pager_draw,
pager_request,
pager_grep,