Commit 304d3983 authored by Friedemann Kleint's avatar Friedemann Kleint
Browse files

Git: Expand commit template relative to repository directory

if it is a relative file specification.
Task-number: QTCREATORBUG-451
parent 6cdb58aa
......@@ -749,8 +749,12 @@ bool GitClient::getCommitData(const QString &workingDirectory,
d->panelData.email = readConfigValue(workingDirectory, QLatin1String("user.email"));
// Get the commit template
const QString templateFilename = readConfigValue(workingDirectory, QLatin1String("commit.template"));
QString templateFilename = readConfigValue(workingDirectory, QLatin1String("commit.template"));
if (!templateFilename.isEmpty()) {
// Make relative to repository
const QFileInfo templateFileInfo(templateFilename);
if (templateFileInfo.isRelative())
templateFilename = repoDirectory + QLatin1Char('/') + templateFilename;
QFile templateFile(templateFilename);
if (templateFile.open(QIODevice::ReadOnly|QIODevice::Text)) {
*commitTemplate = QString::fromLocal8Bit(templateFile.readAll());
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment