aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit/src/org/eclipse
diff options
context:
space:
mode:
authorMatthias Sohn <matthias.sohn@sap.com>2018-03-10 00:37:07 +0100
committerMatthias Sohn <matthias.sohn@sap.com>2018-03-10 19:41:24 +0100
commite1cfe09bfa5b5d9d94189de47301b293ee72b70e (patch)
treee75385289deba9111fda021a6b9662ef020ed433 /org.eclipse.jgit/src/org/eclipse
parentd061343619e635f5f6490d4bad472cde4b3dd077 (diff)
downloadjgit-e1cfe09bfa5b5d9d94189de47301b293ee72b70e.tar.gz
jgit-e1cfe09bfa5b5d9d94189de47301b293ee72b70e.zip
Remove deprecated Repository#getRef
Use Repository#exactRef(String) or Repository#findRef(String) instead. Change-Id: I5c547a26604b4cd792111c699df5f3c9d955d3f2 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Diffstat (limited to 'org.eclipse.jgit/src/org/eclipse')
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/lib/Repository.java26
1 files changed, 4 insertions, 22 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/Repository.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/Repository.java
index 4c0bde1376..42ca248459 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/Repository.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/Repository.java
@@ -486,7 +486,7 @@ public abstract class Repository implements AutoCloseable {
try (RevWalk rw = new RevWalk(this)) {
Object resolved = resolve(rw, revstr);
if (resolved instanceof String) {
- final Ref ref = getRef((String)resolved);
+ final Ref ref = findRef((String) resolved);
return ref != null ? ref.getLeaf().getObjectId() : null;
} else {
return (ObjectId) resolved;
@@ -709,7 +709,7 @@ public abstract class Repository implements AutoCloseable {
.format(JGitText.get().invalidRefName,
name),
revstr);
- Ref ref = getRef(name);
+ Ref ref = findRef(name);
name = null;
if (ref == null)
return null;
@@ -762,7 +762,7 @@ public abstract class Repository implements AutoCloseable {
.format(JGitText.get().invalidRefName,
name),
revstr);
- Ref ref = getRef(name);
+ Ref ref = findRef(name);
name = null;
if (ref == null)
return null;
@@ -813,7 +813,7 @@ public abstract class Repository implements AutoCloseable {
throw new RevisionSyntaxException(
MessageFormat.format(JGitText.get().invalidRefName, name),
revstr);
- if (getRef(name) != null)
+ if (findRef(name) != null)
return name;
return resolveSimple(name);
}
@@ -1057,24 +1057,6 @@ public abstract class Repository implements AutoCloseable {
* Get a ref by name.
*
* @param name
- * the name of the ref to lookup. May be a short-hand form, e.g.
- * "master" which is is automatically expanded to
- * "refs/heads/master" if "refs/heads/master" already exists.
- * @return the Ref with the given name, or {@code null} if it does not exist
- * @throws java.io.IOException
- * @deprecated Use {@link #exactRef(String)} or {@link #findRef(String)}
- * instead.
- */
- @Deprecated
- @Nullable
- public Ref getRef(final String name) throws IOException {
- return findRef(name);
- }
-
- /**
- * Get a ref by name.
- *
- * @param name
* the name of the ref to lookup. Must not be a short-hand
* form; e.g., "master" is not automatically expanded to
* "refs/heads/master".