Merge branch 'stable-2.11' into stable-2.12

* stable-2.11:
  AccountManager: Update display name only if it is not null.
  ChangeHookValidator: Fix old revision retrieval for root commit
  InlineEdit: Enable inline comments retrieval in change screen
  BanCommitCommand: Do not use commons.collections

Change-Id: Iddb4b9ea60428a271457c082b77afb787606dc24
This commit is contained in:
David Pursehouse
2015-11-12 12:29:24 -08:00
6 changed files with 21 additions and 9 deletions

View File

@@ -14,6 +14,7 @@
package com.google.gerrit.server.account;
import com.google.common.base.Strings;
import com.google.gerrit.audit.AuditService;
import com.google.gerrit.common.TimeUtil;
import com.google.gerrit.common.data.AccessSection;
@@ -175,7 +176,7 @@ public class AccountManager {
}
if (!realm.allowsEdit(Account.FieldName.FULL_NAME)
&& who.getDisplayName() != null
&& !Strings.isNullOrEmpty(who.getDisplayName())
&& !eq(user.getAccount().getFullName(), who.getDisplayName())) {
toUpdate = load(toUpdate, user.getAccountId(), db);
toUpdate.setFullName(who.getDisplayName());

View File

@@ -564,8 +564,10 @@ public class CommitValidators {
IdentifiedUser user = refControl.getUser().asIdentifiedUser();
String refname = receiveEvent.refName;
ObjectId old = receiveEvent.commit.getParent(0);
ObjectId old = ObjectId.zeroId();
if (receiveEvent.commit.getParentCount() > 0) {
old = receiveEvent.commit.getParent(0);
}
if (receiveEvent.command.getRefName().startsWith(REFS_CHANGES)) {
/*
* If the ref-update hook tries to distinguish behavior between pushes to