DescribeCommand: Refactor to not use deprecated Repository#peel

Change-Id: I76073ad62d1bc4fc21d8a1f5fc7eb92060a73baa
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
This commit is contained in:
David Pursehouse 2018-05-22 12:08:08 +09:00
parent f6c4a492d0
commit 51599ebb84
1 changed files with 9 additions and 5 deletions

View File

@ -224,12 +224,16 @@ private Optional<Ref> getBestMatch(List<Ref> tags) {
}
}
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;
}
/**