summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOrgad Shaneh <orgad.shaneh@audiocodes.com>2013-03-18 08:01:54 +0200
committerOrgad Shaneh <orgads@gmail.com>2013-03-19 15:17:29 +0100
commit82679ff61c3dc78e34e9ab2ea2a514262db6245a (patch)
treea59af0f816fd622f7e84ff0c3e10fa2c6f9acf9c
parenta4764ad9ef2fb9d003fa5c6579834d543ee516ac (diff)
downloadqt-creator-82679ff61c3dc78e34e9ab2ea2a514262db6245a.tar.gz
Git: Support SQUASH_MSG for commit message
Created for a squashed merge commit Change-Id: I984a02cb27c678ff96950e788b212d85b8516a5b Reviewed-by: Eike Ziller <eike.ziller@digia.com> Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
-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