Merge branch 'stable-2.14'

* stable-2.14:
  ReceiveCommits: parseBody before getFooterLines
  Remove reference to non-existing account_ssh_keys table from docs
  DeleteRef: Pass project name into validateRefOperation
  Be more consistent about object ids used in ref operation validation
  Be more consistent about object ids used in ref operation validation

Change-Id: I5e532f5d2af6a589751e63fa21872df28568e4d8
This commit is contained in:
Dave Borowitz 2017-03-24 12:32:02 -07:00
commit a96fdf27da
4 changed files with 7 additions and 6 deletions

View File

@ -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"`::
+

View File

@ -1768,6 +1768,7 @@ public class ReceiveCommits {
break;
}
total++;
rp.getRevWalk().parseBody(c);
String name = c.name();
groupCollector.visit(c);
Collection<Ref> existingRefs = existing.get(c);

View File

@ -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;

View File

@ -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;
}