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()
QString GitSubmitEditorPanelData::authorString() const
{
QString rc;
rc += QLatin1Char('"');
rc += author;
rc += QLatin1String("\" <");
if (email.isEmpty())
return rc;
rc += QLatin1String(" <");
rc += email;
rc += QLatin1Char('>');
return rc;
......
......@@ -791,8 +791,11 @@ bool GitClient::addAndCommit(const QString &repositoryDirectory,
// Do the final commit
QStringList args;
args << QLatin1String("commit")
<< QLatin1String("-F") << QDir::toNativeSeparators(messageFile)
<< QLatin1String("--author") << data.authorString();
<< QLatin1String("-F") << QDir::toNativeSeparators(messageFile);
const QString &authorString = data.authorString();
if (!authorString.isEmpty())
args << QLatin1String("--author") << authorString;
QByteArray outputText;
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