Commit 839bc1e9 authored by dt's avatar dt
Browse files

Fixes commiting with empty author/email information

Also only filling in the author field works, git does magic then.
Also fix quoting
parent c7850c3f
...@@ -61,9 +61,12 @@ void GitSubmitEditorPanelData::clear() ...@@ -61,9 +61,12 @@ void GitSubmitEditorPanelData::clear()
QString GitSubmitEditorPanelData::authorString() const QString GitSubmitEditorPanelData::authorString() const
{ {
QString rc; QString rc;
rc += QLatin1Char('"');
rc += author; rc += author;
rc += QLatin1String("\" <");
if (email.isEmpty())
return rc;
rc += QLatin1String(" <");
rc += email; rc += email;
rc += QLatin1Char('>'); rc += QLatin1Char('>');
return rc; return rc;
......
...@@ -791,8 +791,11 @@ bool GitClient::addAndCommit(const QString &repositoryDirectory, ...@@ -791,8 +791,11 @@ bool GitClient::addAndCommit(const QString &repositoryDirectory,
// Do the final commit // Do the final commit
QStringList args; QStringList args;
args << QLatin1String("commit") args << QLatin1String("commit")
<< QLatin1String("-F") << QDir::toNativeSeparators(messageFile) << QLatin1String("-F") << QDir::toNativeSeparators(messageFile);
<< QLatin1String("--author") << data.authorString();
const QString &authorString = data.authorString();
if (!authorString.isEmpty())
args << QLatin1String("--author") << authorString;
QByteArray outputText; QByteArray outputText;
QByteArray errorText; QByteArray errorText;
......
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