diff options
author | Matthias Sohn <matthias.sohn@sap.com> | 2016-05-20 11:28:21 +0200 |
---|---|---|
committer | Matthias Sohn <matthias.sohn@sap.com> | 2016-05-31 00:11:11 +0200 |
commit | 4c236ff4bbf664fd177a33f42517b0eef52510c8 (patch) | |
tree | f4bec49bded5342a3be25c271a5a910751ce63d4 /org.eclipse.jgit.pgm/src | |
parent | bfebe6ae4bf50250eca20b7c6bea0d06e771a817 (diff) | |
download | jgit-4c236ff4bbf664fd177a33f42517b0eef52510c8.tar.gz jgit-4c236ff4bbf664fd177a33f42517b0eef52510c8.zip |
Replace use of deprecated method Repository.getRef()
Change-Id: Iecf2b8deafc4991cc3333702fb9fa0638be7b914
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Diffstat (limited to 'org.eclipse.jgit.pgm/src')
5 files changed, 9 insertions, 9 deletions
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Branch.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Branch.java index bf6ee3a945..5f3740cbba 100644 --- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Branch.java +++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Branch.java @@ -169,7 +169,7 @@ class Branch extends TextBuiltin { if (rename) { String src, dst; if (otherBranch == null) { - final Ref head = db.getRef(Constants.HEAD); + final Ref head = db.exactRef(Constants.HEAD); if (head != null && head.isSymbolic()) { src = head.getLeaf().getName(); } else { @@ -178,7 +178,7 @@ class Branch extends TextBuiltin { dst = branch; } else { src = branch; - final Ref old = db.getRef(src); + final Ref old = db.findRef(src); if (old == null) throw die(MessageFormat.format(CLIText.get().doesNotExist, src)); if (!old.getName().startsWith(Constants.R_HEADS)) @@ -204,7 +204,7 @@ class Branch extends TextBuiltin { } else { startBranch = Constants.HEAD; } - Ref startRef = db.getRef(startBranch); + Ref startRef = db.findRef(startBranch); ObjectId startAt = db.resolve(startBranch + "^0"); //$NON-NLS-1$ if (startRef != null) { startBranch = startRef.getName(); @@ -243,7 +243,7 @@ class Branch extends TextBuiltin { } private void list() throws Exception { - Ref head = db.getRef(Constants.HEAD); + Ref head = db.exactRef(Constants.HEAD); // This can happen if HEAD is stillborn if (head != null) { String current = head.getLeaf().getName(); diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Commit.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Commit.java index 38d8d70cef..2cfbd86fa3 100644 --- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Commit.java +++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Commit.java @@ -95,7 +95,7 @@ class Commit extends TextBuiltin { commitCmd.setOnly(p); commitCmd.setAmend(amend); commitCmd.setAll(all); - Ref head = db.getRef(Constants.HEAD); + Ref head = db.exactRef(Constants.HEAD); if (head == null) { throw die(CLIText.get().onBranchToBeBorn); } diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Log.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Log.java index 6947cdd100..62e77285b9 100644 --- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Log.java +++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Log.java @@ -228,7 +228,7 @@ class Log extends RevWalkTextBuiltin { } private void addNoteMap(String notesRef) throws IOException { - Ref notes = db.getRef(notesRef); + Ref notes = db.exactRef(notesRef); if (notes == null) return; RevCommit notesCommit = argWalk.parseCommit(notes.getObjectId()); diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Merge.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Merge.java index e739b58ae7..485efc5428 100644 --- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Merge.java +++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Merge.java @@ -114,7 +114,7 @@ class Merge extends TextBuiltin { } // determine the other revision we want to merge with HEAD - final Ref srcRef = db.getRef(ref); + final Ref srcRef = db.findRef(ref); final ObjectId src = db.resolve(ref + "^{commit}"); //$NON-NLS-1$ if (src == null) throw die(MessageFormat.format( @@ -209,7 +209,7 @@ class Merge extends TextBuiltin { } private Ref getOldHead() throws IOException { - Ref oldHead = db.getRef(Constants.HEAD); + Ref oldHead = db.exactRef(Constants.HEAD); if (oldHead == null) { throw die(CLIText.get().onBranchToBeBorn); } diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Status.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Status.java index 6a6322131a..de3df806d8 100644 --- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Status.java +++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Status.java @@ -204,7 +204,7 @@ class Status extends TextBuiltin { private void printLongStatus(org.eclipse.jgit.api.Status status) throws IOException { // Print current branch name - final Ref head = db.getRef(Constants.HEAD); + final Ref head = db.exactRef(Constants.HEAD); if (head != null && head.isSymbolic()) { String branch = Repository.shortenRefName(head.getLeaf().getName()); outw.println(CLIText.formatLine(MessageFormat.format( |