From: Minh Thai Date: Fri, 23 Mar 2018 00:11:45 +0000 (-0700) Subject: scanPacks to return reftables even if no packs X-Git-Tag: v5.0.0.201805151920-m7~63 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=refs%2Fchanges%2F28%2F120028%2F1;p=jgit.git scanPacks to return reftables even if no packs An empty repository may have a dangling symref HEAD pointing to refs/heads/master. In this case, there will be a reftable even though there are no packs yet. Change-Id: Ib759ffbbfc490953481853e74263dd46d2592888 Signed-off-by: Minh Thai --- diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsObjDatabase.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsObjDatabase.java index 42b1a479d8..8e9ed5d0d8 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsObjDatabase.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsObjDatabase.java @@ -546,7 +546,7 @@ public abstract class DfsObjDatabase extends ObjectDatabase { } } - if (newPacks.isEmpty()) + if (newPacks.isEmpty() && newReftables.isEmpty()) return new PackListImpl(NO_PACKS.packs, NO_PACKS.reftables); if (!foundNew) { old.clearDirty();