From bf8057058e126f7ca325d6a45b96de73ddd14844 Mon Sep 17 00:00:00 2001 From: Minh Thai Date: Thu, 22 Mar 2018 17:11:45 -0700 Subject: [PATCH] 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 --- .../org/eclipse/jgit/internal/storage/dfs/DfsObjDatabase.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 42b1a479d..8e9ed5d0d 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();