aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit
diff options
context:
space:
mode:
authorDavid Pursehouse <david.pursehouse@gmail.com>2018-05-22 12:08:08 +0900
committerDavid Pursehouse <david.pursehouse@gmail.com>2018-05-22 12:08:08 +0900
commit51599ebb84f3544df5b618dcce1995a569ce412c (patch)
treee6471371ac8516303f31967bf31d0835dea48315 /org.eclipse.jgit
parentf6c4a492d06e0dd345679bfba3399dabbf778f41 (diff)
downloadjgit-51599ebb84f3544df5b618dcce1995a569ce412c.tar.gz
jgit-51599ebb84f3544df5b618dcce1995a569ce412c.zip
DescribeCommand: Refactor to not use deprecated Repository#peel
Change-Id: I76073ad62d1bc4fc21d8a1f5fc7eb92060a73baa Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
Diffstat (limited to 'org.eclipse.jgit')
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/api/DescribeCommand.java14
1 files changed, 9 insertions, 5 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/DescribeCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/DescribeCommand.java
index 7f1ed8c148..dc605a91e5 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/api/DescribeCommand.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/DescribeCommand.java
@@ -224,12 +224,16 @@ public class DescribeCommand extends GitCommand<String> {
}
}
- private ObjectId getObjectIdFromRef(Ref r) {
- ObjectId key = repo.peel(r).getPeeledObjectId();
- if (key == null) {
- key = r.getObjectId();
+ private ObjectId getObjectIdFromRef(Ref r) throws JGitInternalException {
+ try {
+ ObjectId key = repo.getRefDatabase().peel(r).getPeeledObjectId();
+ if (key == null) {
+ key = r.getObjectId();
+ }
+ return key;
+ } catch (IOException e) {
+ throw new JGitInternalException(e.getMessage(), e);
}
- return key;
}
/**