Code

Refuse to open blame view for all non-file entries in the tree view
authorJonas Fonseca <fonseca@diku.dk>
Sun, 28 Dec 2008 17:32:12 +0000 (12:32 -0500)
committerJonas Fonseca <fonseca@diku.dk>
Sun, 28 Dec 2008 17:34:07 +0000 (12:34 -0500)
NEWS
tig.c

diff --git a/NEWS b/NEWS
index 5e2cae82a039b33b1095b4cd414e90171ede588a..4d91c7eca9dce38ff9feb9957ead68d4efbf10c3 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -16,6 +16,7 @@ Bug fixes:
  - 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 and deleted files.
+ - Tree view: show error when requesting blame for all non-file entries.
 
 tig-0.12.1
 ----------
diff --git a/tig.c b/tig.c
index db6bde69f1b8062fd0b45f306d12c762b87fc631..6f25bec53f3435f7c6fb82068edd00ec318a64cd 100644 (file)
--- a/tig.c
+++ b/tig.c
@@ -3365,8 +3365,8 @@ tree_request(struct view *view, enum request request, struct line *line)
        if (request == REQ_VIEW_BLAME) {
                const char *filename = tree_path(line);
 
-               if (line->type == LINE_TREE_DIR) {
-                       report("Cannot show blame for directory %s", opt_path);
+               if (line->type != LINE_TREE_FILE) {
+                       report("Blame only supported for files");
                        return REQ_NONE;
                }