Convert Branch.NameKey to AutoValue

See I6982fb24 for context.

Change-Id: I7a79a374c9efdd4ccd9ab5169562fb8ae3452120
This commit is contained in:
Dave Borowitz
2019-04-17 15:53:44 -07:00
parent 19ef3c8968
commit ac3b3d63d1
114 changed files with 436 additions and 451 deletions

View File

@@ -146,10 +146,10 @@ public class Rebase extends RetryingRestModifyView<RevisionResource, RebaseInput
String str = input.base.trim();
if (str.equals("")) {
// Remove existing dependency to other patch set.
Ref destRef = repo.exactRef(destRefKey.get());
Ref destRef = repo.exactRef(destRefKey.branch());
if (destRef == null) {
throw new ResourceConflictException(
"can't rebase onto tip of branch " + destRefKey.get() + "; branch doesn't exist");
"can't rebase onto tip of branch " + destRefKey.branch() + "; branch doesn't exist");
}
return destRef.getObjectId();
}
@@ -230,7 +230,7 @@ public class Rebase extends RetryingRestModifyView<RevisionResource, RebaseInput
}
boolean enabled = false;
try (Repository repo = repoManager.openRepository(change.getDest().getParentKey());
try (Repository repo = repoManager.openRepository(change.getDest().project());
RevWalk rw = new RevWalk(repo)) {
if (hasOneParent(rw, rsrc.getPatchSet())) {
enabled = rebaseUtil.canRebase(rsrc.getPatchSet(), change.getDest(), repo, rw);