]> source.dussan.org Git - jgit.git/commit
RefDatabase: add hasRefs convenience method 02/121902/2
authorDavid Pursehouse <david.pursehouse@gmail.com>
Fri, 27 Apr 2018 12:49:08 +0000 (21:49 +0900)
committerMatthias Sohn <matthias.sohn@sap.com>
Sun, 29 Apr 2018 20:03:07 +0000 (22:03 +0200)
commit9fb724f1b9f9f6920852a922abe2c316fc8d25d6
treeedb0ff72663e2fe7f101d18197c327302fadf003
parentd4f3ae0c43c5602b0ca17f4274ee4ffb928f8f7f
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 <david.pursehouse@gmail.com>
org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/RebuildCommitGraph.java
org.eclipse.jgit/src/org/eclipse/jgit/lib/RefDatabase.java