Fix deprecation warnings from latest JGit update

- FS is no longer required for LockFile constructor.
 - TestRepository#getClock was renamed getDate.
 - Replace usages of RefDatabase#getRef with either exactRef, when we
   know we can bypass the full lookup path, or findRef, where the
   input is user-provided and we might need to add an implicit prefix.

Change-Id: I6309b91ccf99ffaa724be273ddae0d9857b825f9
This commit is contained in:
Dave Borowitz
2016-01-06 10:34:50 -05:00
parent bb5c68c4b9
commit f83c424b4b
25 changed files with 44 additions and 48 deletions

View File

@@ -102,7 +102,7 @@ public class AccountIT extends AbstractDaemonTest {
@After
public void clearPublicKeyStore() throws Exception {
try (Repository repo = repoManager.openRepository(allUsers)) {
Ref ref = repo.getRef(REFS_GPG_KEYS);
Ref ref = repo.exactRef(REFS_GPG_KEYS);
if (ref != null) {
RefUpdate ru = repo.updateRef(REFS_GPG_KEYS);
ru.setForceUpdate(true);

View File

@@ -106,7 +106,7 @@ public class ChangeIT extends AbstractDaemonTest {
gApi.changes().id(changeId).get();
BranchInput b = new BranchInput();
b.revision = repo().getRef("HEAD").getObjectId().name();
b.revision = repo().exactRef("HEAD").getObjectId().name();
gApi.projects()
.name(project.get())
.branch("other")

View File

@@ -377,7 +377,7 @@ public class RevisionIT extends AbstractDaemonTest {
@Test
public void mergeable() throws Exception {
ObjectId initial = repo().getRef(HEAD).getLeaf().getObjectId();
ObjectId initial = repo().exactRef(HEAD).getLeaf().getObjectId();
PushOneCommit push1 =
pushFactory.create(db, admin.getIdent(), testRepo, PushOneCommit.SUBJECT,