From 9fb724f1b9f9f6920852a922abe2c316fc8d25d6 Mon Sep 17 00:00:00 2001 From: David Pursehouse Date: Fri, 27 Apr 2018 21:49:08 +0900 Subject: RefDatabase: add hasRefs convenience method Callers can now say: db.getRefDatabase().hasRefs() rather than the more verbose: !db.getRefDatabase().getAllRefs().isEmpty() The default implementation simply uses getAllRefs().isEmpty(), but a derived class could possibly override the method with a more efficient implementation. Change-Id: I5244520708a1a7d9adb351f10e43fc39d98e22a1 Signed-off-by: David Pursehouse --- .../src/org/eclipse/jgit/pgm/debug/RebuildCommitGraph.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'org.eclipse.jgit.pgm/src') diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/RebuildCommitGraph.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/RebuildCommitGraph.java index 666fc34e26..19d94eadef 100644 --- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/RebuildCommitGraph.java +++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/RebuildCommitGraph.java @@ -115,7 +115,7 @@ class RebuildCommitGraph extends TextBuiltin { /** {@inheritDoc} */ @Override protected void run() throws Exception { - if (!really && !db.getRefDatabase().getAllRefs().isEmpty()) { + if (!really && db.getRefDatabase().hasRefs()) { File directory = db.getDirectory(); String absolutePath = directory == null ? "null" //$NON-NLS-1$ : directory.getAbsolutePath(); -- cgit v1.2.3