Browse Source

DescribeCommand: Refactor to not use deprecated Repository#peel

Change-Id: I76073ad62d1bc4fc21d8a1f5fc7eb92060a73baa
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
stable-5.1
David Pursehouse 7 years ago
parent
commit
51599ebb84
  1. 14
      org.eclipse.jgit/src/org/eclipse/jgit/api/DescribeCommand.java

14
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;
}
/**

Loading…
Cancel
Save