Get correct remote head in PrivateByDefaultIT.
pushDraftsWithPrivateByDefaultAndDisablePrivateChangesTrue calls
getRemoteHead() which uses the default repository from
AbstractDaemonTest.
If AbstractDaemonTest#setup and PrivateByDefaultIT#setup run far
enough apart, the commit timestamps drift making remote head SHA1s
different, causing a test failure.
Change-Id: Ifc2b32622c26292e36f58e02b02cb4937c376c19
diff --git a/javatests/com/google/gerrit/acceptance/rest/change/PrivateByDefaultIT.java b/javatests/com/google/gerrit/acceptance/rest/change/PrivateByDefaultIT.java
index 936feed..c2d3817 100644
--- a/javatests/com/google/gerrit/acceptance/rest/change/PrivateByDefaultIT.java
+++ b/javatests/com/google/gerrit/acceptance/rest/change/PrivateByDefaultIT.java
@@ -130,7 +130,7 @@
public void pushDraftsWithPrivateByDefaultAndDisablePrivateChangesTrue() throws Exception {
setPrivateByDefault(project2, InheritableBoolean.TRUE);
- RevCommit initialHead = getRemoteHead();
+ RevCommit initialHead = getRemoteHead(project2, "master");
TestRepository<InMemoryRepository> testRepo = cloneProject(project2);
PushOneCommit.Result result =
pushFactory.create(db, admin.getIdent(), testRepo).to("refs/for/master%draft");