Git: Output standard error on commit success

post-commit or commit-msg hook might print useful information even
without failing the commit

Change-Id: I91b6ccfc43f1d148fb773ae074b2668927815235
Reviewed-by: Petar Perisin <petar.perisin@gmail.com>
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
This commit is contained in:
Orgad Shaneh
2013-05-10 16:18:27 +03:00
committed by Orgad Shaneh
parent af6f57b17c
commit 20c3d45409

View File

@@ -2239,10 +2239,13 @@ bool GitClient::addAndCommit(const QString &repositoryDirectory,
QByteArray errorText;
const bool rc = fullySynchronousGit(repositoryDirectory, args, &outputText, &errorText);
if (rc)
const QString stdErr = commandOutputFromLocal8Bit(errorText);
if (rc) {
outputWindow()->append(msgCommitted(amendSHA1, commitCount));
else
outputWindow()->appendError(tr("Cannot commit %n file(s): %1\n", 0, commitCount).arg(commandOutputFromLocal8Bit(errorText)));
outputWindow()->appendError(stdErr);
} else {
outputWindow()->appendError(tr("Cannot commit %n file(s): %1\n", 0, commitCount).arg(stdErr));
}
return rc;
}