From e7a23272068ab950bffc0cc25c12e7de48607805 Mon Sep 17 00:00:00 2001
From: Orgad Shaneh <orgads@gmail.com>
Date: Sun, 11 Dec 2011 15:04:59 +0200
Subject: [PATCH] Git: Use MERGE_MSG as commit template when exists

Change-Id: I6aedc91309f8599004e467f9e733d7935fc9c266
Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
---
 src/plugins/git/gitclient.cpp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/plugins/git/gitclient.cpp b/src/plugins/git/gitclient.cpp
index 8d44091d839..41c6529c79d 100644
--- a/src/plugins/git/gitclient.cpp
+++ b/src/plugins/git/gitclient.cpp
@@ -1659,7 +1659,9 @@ bool GitClient::getCommitData(const QString &workingDirectory,
         *commitTemplate = sp.stdOut.mid(separatorPos + 1);
     } else {
         // Commit: Get the commit template
-        QString templateFilename = readConfigValue(workingDirectory, QLatin1String("commit.template"));
+        QString templateFilename = gitDir.absoluteFilePath(QLatin1String("MERGE_MSG"));
+        if (!QFileInfo(templateFilename).isFile())
+            templateFilename = readConfigValue(workingDirectory, QLatin1String("commit.template"));
         if (!templateFilename.isEmpty()) {
             // Make relative to repository
             const QFileInfo templateFileInfo(templateFilename);
-- 
GitLab