Merge remote-tracking branch 'origin/4.3'

Change-Id: I56004e3ec9dc9d92d33bdae438c4f7e069eccc45
This commit is contained in:
Orgad Shaneh
2017-06-02 15:03:36 +03:00
38 changed files with 225 additions and 54 deletions

View File

@@ -546,7 +546,9 @@ static GerritUser parseGerritUser(const QJsonObject &object)
static int numberValue(const QJsonObject &object)
{
return object.value("number").toString().toInt();
const QJsonValue number = object.value("number");
// Since Gerrit 2.14 (commits fa92467dc and b0cfe1401) the change and patch set numbers are int
return number.isString() ? number.toString().toInt() : number.toInt();
}
/* Parse gerrit query Json output.

View File

@@ -86,7 +86,7 @@ const char stashNamePrefix[] = "stash@{";
const char noColorOption[] = "--no-color";
const char decorateOption[] = "--decorate";
const char showFormatC[] =
"--pretty=format:commit %H%n"
"--pretty=format:commit %H%d%n"
"Author: %an <%ae>, %ad (%ar)%n"
"Committer: %cn <%ce>, %cd (%cr)%n"
"%n"
@@ -359,7 +359,7 @@ private:
void ShowController::reload()
{
const QStringList args = {"show", "-s", noColorOption, decorateOption, showFormatC, m_id};
const QStringList args = {"show", "-s", noColorOption, showFormatC, m_id};
m_state = GettingDescription;
runCommand(QList<QStringList>() << args, GitPlugin::client()->encoding(m_directory, "i18n.commitEncoding"));
}

View File

@@ -190,6 +190,7 @@ QString GitPlugin::invalidBranchAndRemoteNamePattern()
"|//" // no double slash
"|^[/-]" // no leading slash or dash
"|\"" // no quotes
"|\\*" // no asterisk
);
}