Code

Fix crash when opening mergetool for lines that are not unmerged
authorJonas Fonseca <fonseca@diku.dk>
Wed, 10 Oct 2007 14:49:28 +0000 (16:49 +0200)
committerJonas Fonseca <fonseca@diku.dk>
Wed, 10 Oct 2007 14:57:24 +0000 (16:57 +0200)
tig.c

diff --git a/tig.c b/tig.c
index a3cebbf305803fb8108ddb86093401cac3943b2c..06c3d040d9352029bf62cae4df7e99f81ca2b666 100644 (file)
--- a/tig.c
+++ b/tig.c
@@ -3533,6 +3533,10 @@ status_request(struct view *view, enum request request, struct line *line)
                break;
 
        case REQ_STATUS_MERGE:
+               if (!status || status->status != 'U') {
+                       report("Merging only possible for files with unmerged status ('U').");
+                       return REQ_NONE;
+               }
                open_mergetool(status->name);
                break;