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>
This commit is contained in:
Orgad Shaneh
2013-03-18 08:01:54 +02:00
committed by Orgad Shaneh
parent a4764ad9ef
commit 82679ff61c

View File

@@ -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