Merge "Revert "Create ref for new patch set on direct push""

This commit is contained in:
David Pursehouse
2013-01-09 02:18:28 -08:00
committed by Gerrit Code Review

View File

@@ -95,7 +95,6 @@ import org.eclipse.jgit.lib.ObjectId;
import org.eclipse.jgit.lib.ObjectReader;
import org.eclipse.jgit.lib.PersonIdent;
import org.eclipse.jgit.lib.Ref;
import org.eclipse.jgit.lib.RefUpdate;
import org.eclipse.jgit.lib.Repository;
import org.eclipse.jgit.notes.NoteMap;
import org.eclipse.jgit.revwalk.FooterKey;
@@ -1636,7 +1635,7 @@ public class ReceiveCommits {
ListenableFuture<PatchSet.Id> future = changeUpdateExector.submit(
requestScopePropagator.wrap(new Callable<PatchSet.Id>() {
@Override
public PatchSet.Id call() throws OrmException, IOException {
public PatchSet.Id call() throws OrmException {
try {
if (caller == Thread.currentThread()) {
return insertPatchSet(db);
@@ -1658,7 +1657,7 @@ public class ReceiveCommits {
return Futures.makeChecked(future, ORM_EXCEPTION);
}
PatchSet.Id insertPatchSet(ReviewDb db) throws OrmException, IOException {
PatchSet.Id insertPatchSet(ReviewDb db) throws OrmException {
final Account.Id me = currentUser.getAccountId();
final List<FooterLine> footerLines = newCommit.getFooterLines();
final MailRecipients recipients = new MailRecipients(reviewerId, ccId);
@@ -1746,14 +1745,7 @@ public class ReceiveCommits {
markChangeMergedByPush(db, this);
}
final RefUpdate ru = repo.updateRef(newPatchSet.getRefName());
ru.setNewObjectId(newCommit);
ru.disableRefLog();
if (ru.update(rp.getRevWalk()) != RefUpdate.Result.NEW) {
throw new IOException("Failed to create ref " + newPatchSet.getRefName() + " in "
+ repo.getDirectory() + ": " + ru.getResult());
}
replication.fire(project.getNameKey(), ru.getName());
replication.fire(project.getNameKey(), newPatchSet.getRefName());
hooks.doPatchsetCreatedHook(change, newPatchSet, db);
if (mergedIntoRef != null) {
hooks.doChangeMergedHook(