From 51599ebb84f3544df5b618dcce1995a569ce412c Mon Sep 17 00:00:00 2001 From: David Pursehouse Date: Tue, 22 May 2018 12:08:08 +0900 Subject: [PATCH] DescribeCommand: Refactor to not use deprecated Repository#peel Change-Id: I76073ad62d1bc4fc21d8a1f5fc7eb92060a73baa Signed-off-by: David Pursehouse --- .../src/org/eclipse/jgit/api/DescribeCommand.java | 14 +++++++++----- 1 file 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 7f1ed8c14..dc605a91e 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 { } } - 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; } /**