From 581a2b04f0afe52adb557acb5e1f61baf8d0f635 Mon Sep 17 00:00:00 2001 From: Jonas Fonseca Date: Sun, 16 Nov 2008 21:40:17 +0100 Subject: [PATCH] Refuse to open deleted files from the status and stage views --- NEWS | 2 +- tig.c | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 47b5af8..5e2cae8 100644 --- a/NEWS +++ b/NEWS @@ -15,7 +15,7 @@ Bug fixes: - Separate blame revision and file argument by "--" to avoid problems. - Main view: fix redrawing of the last commit wrt. the revision graph. - Fix waiting for input after executing a run request in pager mode. - - Status & stage view: refuse to open directories. + - Status & stage view: refuse to open directories and deleted files. tig-0.12.1 ---------- diff --git a/tig.c b/tig.c index 041e282..db6bde6 100644 --- a/tig.c +++ b/tig.c @@ -4438,6 +4438,10 @@ status_request(struct view *view, enum request request, struct line *line) case REQ_EDIT: if (!status) return request; + if (status->status == 'D') { + report("File has been deleted."); + return REQ_NONE; + } open_editor(status->status != '?', status->new.name); break; @@ -4756,6 +4760,10 @@ stage_request(struct view *view, enum request request, struct line *line) case REQ_EDIT: if (!stage_status.new.name[0]) return request; + if (stage_status.status == 'D') { + report("File has been deleted."); + return REQ_NONE; + } open_editor(stage_status.status != '?', stage_status.new.name); break; -- 2.30.2