diff --git a/src/plugins/git/gitclient.cpp b/src/plugins/git/gitclient.cpp
index 155769d995f4c060c6448f48b0493aec525d8802..d8d279ee1d04c2642b26523dbb4dda19333e8c3b 100644
--- a/src/plugins/git/gitclient.cpp
+++ b/src/plugins/git/gitclient.cpp
@@ -2686,8 +2686,11 @@ bool GitClient::getCommitData(const QString &workingDirectory,
         QString templateFilename = gitDirectory.absoluteFilePath(QLatin1String("MERGE_MSG"));
         if (!QFile::exists(templateFilename))
             templateFilename = gitDirectory.absoluteFilePath(QLatin1String("SQUASH_MSG"));
-        if (!QFile::exists(templateFilename))
-            templateFilename = readConfigValue(workingDirectory, QLatin1String("commit.template"));
+        if (!QFile::exists(templateFilename)) {
+            Utils::FileName templateName = Utils::FileName::fromUserInput(
+                        readConfigValue(workingDirectory, QLatin1String("commit.template")));
+            templateFilename = templateName.toString();
+        }
         if (!templateFilename.isEmpty()) {
             // Make relative to repository
             const QFileInfo templateFileInfo(templateFilename);