summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: f19442c)
raw | patch | inline | side by side (parent: f19442c)
author | Jonas Fonseca <fonseca@diku.dk> | |
Mon, 9 Feb 2009 03:04:40 +0000 (04:04 +0100) | ||
committer | Jonas Fonseca <fonseca@diku.dk> | |
Mon, 9 Feb 2009 03:19:35 +0000 (04:19 +0100) |
NEWS | patch | blob | history | |
tig.c | patch | blob | history |
index ea3296c79b29f8bb5ba34146811a1422aac3f674..f9b2e7f912328e2aa10846fba327226636416423 100644 (file)
--- a/NEWS
+++ b/NEWS
Bug fixes:
+ - Status view: show error when failing to open a file.
- Blame view: fix problem with uninitialized variable.
- Blame view: use line number information when loading blame for
specific commit.
index b09cbbfc513b89a9bd4701df8bed6a70eb615477..aec50bca39ff98d3d8358789c6a70f676e2d5bfb 100644 (file)
--- a/tig.c
+++ b/tig.c
{
init_io(io, NULL, IO_FD);
io->pipe = *name ? open(name, O_RDONLY) : STDIN_FILENO;
+ if (io->pipe == -1)
+ io->error = errno;
return io->pipe != -1;
}
return TRUE;
}
+static enum request
+status_load_error(struct view *view, struct view *stage, const char *path)
+{
+ if (displayed_views() == 2 || display[current_view] != view)
+ maximize_view(view);
+ report("Failed to load '%s': %s", path, io_strerror(&stage->io));
+ return REQ_NONE;
+}
+
static enum request
status_enter(struct view *view, struct line *line)
{
};
if (!prepare_update(stage, no_head_diff_argv, opt_cdup, FORMAT_DASH))
- return REQ_QUIT;
+ return status_load_error(view, stage, newpath);
} else {
const char *index_show_argv[] = {
"git", "diff-index", "--root", "--patch-with-stat",
};
if (!prepare_update(stage, index_show_argv, opt_cdup, FORMAT_DASH))
- return REQ_QUIT;
+ return status_load_error(view, stage, newpath);
}
if (status)
};
if (!prepare_update(stage, files_show_argv, opt_cdup, FORMAT_DASH))
- return REQ_QUIT;
+ return status_load_error(view, stage, newpath);
if (status)
info = "Unstaged changes to %s";
else
}
if (!prepare_update_file(stage, newpath))
- return REQ_QUIT;
+ return status_load_error(view, stage, newpath);
info = "Untracked file %s";
break;
/* After returning the status view has been split to
* show the stage view. No further reloading is
* necessary. */
- status_enter(view, line);
- return REQ_NONE;
+ return status_enter(view, line);
case REQ_REFRESH:
/* Simply reload the view. */