summaryrefslogtreecommitdiff
path: root/src/plugins/git/gitclient.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/git/gitclient.cpp')
-rw-r--r--src/plugins/git/gitclient.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/plugins/git/gitclient.cpp b/src/plugins/git/gitclient.cpp
index b50601e5d3..c4ec4659f0 100644
--- a/src/plugins/git/gitclient.cpp
+++ b/src/plugins/git/gitclient.cpp
@@ -1853,8 +1853,11 @@ bool GitClient::getCommitData(const QString &workingDirectory,
commitData->panelData.author = readConfigValue(workingDirectory, QLatin1String("user.name"));
commitData->panelData.email = readConfigValue(workingDirectory, QLatin1String("user.email"));
// Commit: Get the commit template
- QString templateFilename = QDir(gitDir).absoluteFilePath(QLatin1String("MERGE_MSG"));
- if (!QFileInfo(templateFilename).isFile())
+ QDir gitDirectory(gitDir);
+ 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 (!templateFilename.isEmpty()) {
// Make relative to repository