forked from qt-creator/qt-creator
Fixes commiting with empty author/email information
Also only filling in the author field works, git does magic then. Also fix quoting
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user