From: Jonas Fonseca Date: Sun, 16 Nov 2008 20:40:17 +0000 (+0100) Subject: Refuse to open deleted files from the status and stage views X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=581a2b04f0afe52adb557acb5e1f61baf8d0f635;p=tig.git Refuse to open deleted files from the status and stage views --- 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;