Commit d4816850 authored by Orgad Shaneh's avatar Orgad Shaneh Committed by Orgad Shaneh
Browse files

Git: Return QByteArray in synchronousShow



Will be used by Grep

Change-Id: I9346707eef2fe55085b0edf090e117fe45afe8bf
Reviewed-by: default avatarTobias Hunger <tobias.hunger@theqtcompany.com>
parent 71166d06
...@@ -1814,7 +1814,7 @@ SubmoduleDataMap GitClient::submoduleList(const QString &workingDirectory) const ...@@ -1814,7 +1814,7 @@ SubmoduleDataMap GitClient::submoduleList(const QString &workingDirectory) const
} }
bool GitClient::synchronousShow(const QString &workingDirectory, const QString &id, bool GitClient::synchronousShow(const QString &workingDirectory, const QString &id,
QString *output, QString *errorMessage) const QByteArray *output, QString *errorMessage) const
{ {
if (!canShow(id)) { if (!canShow(id)) {
*errorMessage = msgCannotShow(id); *errorMessage = msgCannotShow(id);
...@@ -1822,12 +1822,9 @@ bool GitClient::synchronousShow(const QString &workingDirectory, const QString & ...@@ -1822,12 +1822,9 @@ bool GitClient::synchronousShow(const QString &workingDirectory, const QString &
} }
QStringList args(QLatin1String("show")); QStringList args(QLatin1String("show"));
args << QLatin1String(decorateOption) << QLatin1String(noColorOption) << id; args << QLatin1String(decorateOption) << QLatin1String(noColorOption) << id;
QByteArray outputText;
QByteArray errorText; QByteArray errorText;
const bool rc = vcsFullySynchronousExec(workingDirectory, args, &outputText, &errorText); const bool rc = vcsFullySynchronousExec(workingDirectory, args, output, &errorText);
if (rc) if (!rc)
*output = commandOutputFromLocal8Bit(outputText);
else
msgCannotRun(QStringList(QLatin1String("show")), workingDirectory, errorText, errorMessage); msgCannotRun(QStringList(QLatin1String("show")), workingDirectory, errorText, errorMessage);
return rc; return rc;
} }
......
...@@ -226,7 +226,7 @@ public: ...@@ -226,7 +226,7 @@ public:
QString *errorMessage = 0) const; QString *errorMessage = 0) const;
SubmoduleDataMap submoduleList(const QString &workingDirectory) const; SubmoduleDataMap submoduleList(const QString &workingDirectory) const;
bool synchronousShow(const QString &workingDirectory, const QString &id, bool synchronousShow(const QString &workingDirectory, const QString &id,
QString *output, QString *errorMessage) const; QByteArray *output, QString *errorMessage) const;
bool synchronousRevListCmd(const QString &workingDirectory, const QStringList &arguments, bool synchronousRevListCmd(const QString &workingDirectory, const QStringList &arguments,
QString *output, QString *errorMessage = 0) const; QString *output, QString *errorMessage = 0) const;
......
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