Gerrit: Minor cleanup

Change-Id: I7bfa74053c41c68b956929b73a9b50bf77cbf6e4
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
Orgad Shaneh
2017-03-12 23:55:11 +02:00
committed by Orgad Shaneh
parent f9b556621c
commit dbe77890cd

View File

@@ -131,19 +131,17 @@ bool GerritServer::fillFromRemote(const QString &remote, const GerritParameters
host = r.host; host = r.host;
port = r.port; port = r.port;
user.userName = r.userName.isEmpty() ? parameters.server.user.userName : r.userName; user.userName = r.userName.isEmpty() ? parameters.server.user.userName : r.userName;
if (type != GerritServer::Ssh) { if (type == GerritServer::Ssh)
curlBinary = parameters.curl; return true;
if (curlBinary.isEmpty() || !QFile::exists(curlBinary)) curlBinary = parameters.curl;
return false; if (curlBinary.isEmpty() || !QFile::exists(curlBinary))
rootPath = r.path; return false;
// Strip the last part of the path, which is always the repo name rootPath = r.path;
// The rest of the path needs to be inspected to find the root path // Strip the last part of the path, which is always the repo name
// (can be http://example.net/review) // The rest of the path needs to be inspected to find the root path
ascendPath(); // (can be http://example.net/review)
if (!resolveRoot()) ascendPath();
return false; return resolveRoot();
}
return true;
} }
QStringList GerritServer::curlArguments() QStringList GerritServer::curlArguments()