Code

Blame: update blame to selected commit when pressing 'B'
authorJonas Fonseca <fonseca@diku.dk>
Tue, 13 Jan 2009 21:45:51 +0000 (22:45 +0100)
committerJonas Fonseca <fonseca@diku.dk>
Tue, 13 Jan 2009 21:55:16 +0000 (22:55 +0100)
tig.c

diff --git a/tig.c b/tig.c
index f52c8a4505d1c894f83b736b2384961d73f663df..3189f4437aa4abaad606946e5caa9ed394dd19df 100644 (file)
--- a/tig.c
+++ b/tig.c
@@ -3764,6 +3764,15 @@ blame_request(struct view *view, enum request request, struct line *line)
        struct blame *blame = line->data;
 
        switch (request) {
+       case REQ_VIEW_BLAME:
+               if (!blame->commit || !strcmp(blame->commit->id, NULL_ID)) {
+                       report("Commit ID unknown");
+                       break;
+               }
+               string_copy(opt_ref, blame->commit->id);
+               open_view(view, REQ_VIEW_BLAME, OPEN_REFRESH);
+               return request;
+
        case REQ_ENTER:
                if (!blame->commit) {
                        report("No commit loaded yet");