From 82679ff61c3dc78e34e9ab2ea2a514262db6245a Mon Sep 17 00:00:00 2001 From: Orgad Shaneh Date: Mon, 18 Mar 2013 08:01:54 +0200 Subject: Git: Support SQUASH_MSG for commit message Created for a squashed merge commit Change-Id: I984a02cb27c678ff96950e788b212d85b8516a5b Reviewed-by: Eike Ziller Reviewed-by: Tobias Hunger --- src/plugins/git/gitclient.cpp | 7 +++++-- 1 file 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 -- cgit v1.2.1