Gerrit: Workaround gerrit issue when origin has /p prefix

/p was used with older versions of gerrit. It is no longer required, but
still supported.

Change-Id: Ie7c6a941031c56cf805c13518deec0fadb2f69ab
Reviewed-by: André Hartmann <aha_1980@gmx.de>
This commit is contained in:
Orgad Shaneh
2017-06-26 12:15:16 +03:00
committed by Orgad Shaneh
parent b18f9db8d7
commit 5ee1030791

View File

@@ -236,6 +236,10 @@ int GerritServer::testConnection()
Core::ShellCommand::NoOutput);
if (resp.result == SynchronousProcessResponse::Finished) {
QString output = resp.stdOut();
// Gerrit returns an empty response for /p/qt-creator/a/accounts/self
// so consider this as 404.
if (output.isEmpty())
return PageNotFound;
output.remove(0, output.indexOf('\n')); // Strip first line
QJsonDocument doc = QJsonDocument::fromJson(output.toUtf8());
if (!doc.isNull()) {