diff --git a/Documentation/config-gerrit.txt b/Documentation/config-gerrit.txt index a60cb4aaef..2c34b2eefb 100644 --- a/Documentation/config-gerrit.txt +++ b/Documentation/config-gerrit.txt @@ -819,10 +819,6 @@ can match against them during authentication. The unit of storage is per-user, so 1024 items translates to 1024 unique user accounts. As each individual user account may configure multiple SSH keys, the total number of keys may be larger than the item count. -+ -This cache is based off the `account_ssh_keys` table and the -`accounts.ssh_user_name` column in the database. If either is -modified directly, this cache should be flushed. cache `"web_sessions"`:: + diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/git/ReceiveCommits.java b/gerrit-server/src/main/java/com/google/gerrit/server/git/ReceiveCommits.java index e5d570e6ca..1a5f14e6be 100644 --- a/gerrit-server/src/main/java/com/google/gerrit/server/git/ReceiveCommits.java +++ b/gerrit-server/src/main/java/com/google/gerrit/server/git/ReceiveCommits.java @@ -1768,6 +1768,7 @@ public class ReceiveCommits { break; } total++; + rp.getRevWalk().parseBody(c); String name = c.name(); groupCollector.visit(c); Collection existingRefs = existing.get(c); diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/git/validators/RefOperationValidators.java b/gerrit-server/src/main/java/com/google/gerrit/server/git/validators/RefOperationValidators.java index 3641076b09..80792c30d6 100644 --- a/gerrit-server/src/main/java/com/google/gerrit/server/git/validators/RefOperationValidators.java +++ b/gerrit-server/src/main/java/com/google/gerrit/server/git/validators/RefOperationValidators.java @@ -39,7 +39,7 @@ public class RefOperationValidators { public static ReceiveCommand getCommand(RefUpdate update, ReceiveCommand.Type type) { return new ReceiveCommand( - update.getOldObjectId(), update.getNewObjectId(), update.getName(), type); + update.getExpectedOldObjectId(), update.getNewObjectId(), update.getName(), type); } private final RefReceivedEvent event; diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/project/DeleteRef.java b/gerrit-server/src/main/java/com/google/gerrit/server/project/DeleteRef.java index 66df738742..373f56193f 100644 --- a/gerrit-server/src/main/java/com/google/gerrit/server/project/DeleteRef.java +++ b/gerrit-server/src/main/java/com/google/gerrit/server/project/DeleteRef.java @@ -115,8 +115,10 @@ public class DeleteRef { } RefUpdate.Result result; RefUpdate u = r.updateRef(ref); + u.setExpectedOldObjectId(r.exactRef(ref).getObjectId()); + u.setNewObjectId(ObjectId.zeroId()); u.setForceUpdate(true); - refDeletionValidator.validateRefOperation(ref, identifiedUser.get(), u); + refDeletionValidator.validateRefOperation(resource.getName(), identifiedUser.get(), u); int remainingLockFailureCalls = MAX_LOCK_FAILURE_CALLS; for (; ; ) { try { @@ -222,6 +224,8 @@ public class DeleteRef { RefUpdate u = r.updateRef(refName); u.setForceUpdate(true); + u.setExpectedOldObjectId(r.exactRef(refName).getObjectId()); + u.setNewObjectId(ObjectId.zeroId()); refDeletionValidator.validateRefOperation(project.getName(), identifiedUser.get(), u); return command; }