]> source.dussan.org Git - jgit.git/commitdiff
DescribeCommand: Refactor to not use deprecated Repository#peel 36/123036/1
authorDavid Pursehouse <david.pursehouse@gmail.com>
Tue, 22 May 2018 03:08:08 +0000 (12:08 +0900)
committerDavid Pursehouse <david.pursehouse@gmail.com>
Tue, 22 May 2018 03:08:08 +0000 (12:08 +0900)
Change-Id: I76073ad62d1bc4fc21d8a1f5fc7eb92060a73baa
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
org.eclipse.jgit/src/org/eclipse/jgit/api/DescribeCommand.java

index 7f1ed8c14859f15d91011a50f8ff55588bc57893..dc605a91e54865892e9a6cfa44855934b2dddd84 100644 (file)
@@ -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;
        }
 
        /**