diff options
author | Matthias Sohn <matthias.sohn@sap.com> | 2019-01-01 01:06:44 +0100 |
---|---|---|
committer | David Pursehouse <david.pursehouse@gmail.com> | 2019-01-08 18:41:11 -0500 |
commit | 23c30c6310686392dbbff4385b96a3403e09168a (patch) | |
tree | 2b156ef9724fbf36844ed89bdcb80d8bd1c038f1 /org.eclipse.jgit | |
parent | 4207b8d6aee3a74f93de9d9540e265d6efaf43f2 (diff) | |
download | jgit-23c30c6310686392dbbff4385b96a3403e09168a.tar.gz jgit-23c30c6310686392dbbff4385b96a3403e09168a.zip |
Fix warnings for usage of deprecated RefDatabase#getRef
Change-Id: I22a244114ef973b3801cf3b639ff782f21c02f98
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Diffstat (limited to 'org.eclipse.jgit')
4 files changed, 6 insertions, 6 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/RefDirectoryUpdate.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/RefDirectoryUpdate.java index 45ce6349a5..1a0d6953ab 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/RefDirectoryUpdate.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/RefDirectoryUpdate.java @@ -87,7 +87,7 @@ class RefDirectoryUpdate extends RefUpdate { String name = dst.getName(); lock = new LockFile(database.fileFor(name)); if (lock.lock()) { - dst = database.getRef(name); + dst = database.findRef(name); setOldObjectId(dst != null ? dst.getObjectId() : null); return true; } else { diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/RefRename.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/RefRename.java index a05daa00ab..0bd34b51ac 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/RefRename.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/RefRename.java @@ -184,7 +184,7 @@ public abstract class RefRename { * the current value of {@code HEAD} cannot be read. */ protected boolean needToUpdateHEAD() throws IOException { - Ref head = source.getRefDatabase().getRef(Constants.HEAD); + Ref head = source.getRefDatabase().exactRef(Constants.HEAD); if (head != null && head.isSymbolic()) { head = head.getTarget(); return head.getName().equals(source.getName()); diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/RefUpdate.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/RefUpdate.java index fc3ea8467a..1ce1528344 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/RefUpdate.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/RefUpdate.java @@ -665,7 +665,7 @@ public abstract class RefUpdate { : getRef().getLeaf().getName(); if (myName.startsWith(Constants.R_HEADS) && !getRepository().isBare()) { // Don't allow the currently checked out branch to be deleted. - Ref head = getRefDatabase().getRef(Constants.HEAD); + Ref head = getRefDatabase().exactRef(Constants.HEAD); while (head != null && head.isSymbolic()) { head = head.getTarget(); if (myName.equals(head.getName())) @@ -708,7 +708,7 @@ public abstract class RefUpdate { if (!tryLock(false)) return Result.LOCK_FAILURE; - final Ref old = getRefDatabase().getRef(getName()); + final Ref old = getRefDatabase().exactRef(getName()); if (old != null && old.isSymbolic()) { final Ref dst = old.getTarget(); if (target.equals(dst.getName())) @@ -718,7 +718,7 @@ public abstract class RefUpdate { if (old != null && old.getObjectId() != null) setOldObjectId(old.getObjectId()); - final Ref dst = getRefDatabase().getRef(target); + final Ref dst = getRefDatabase().exactRef(target); if (dst != null && dst.getObjectId() != null) setNewObjectId(dst.getObjectId()); diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java index 78bf0fe47b..7700eea9f9 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java @@ -966,7 +966,7 @@ public class UploadPack { List<ObjectId> deepenNots = new ArrayList<>(); for (String s : req.getDeepenNotRefs()) { - Ref ref = db.getRefDatabase().getRef(s); + Ref ref = db.getRefDatabase().findRef(s); if (ref == null) { throw new PackProtocolException(MessageFormat .format(JGitText.get().invalidRefName, s)); |