]> source.dussan.org Git - jgit.git/commitdiff
scanPacks to return reftables even if no packs 28/120028/1
authorMinh Thai <mthai@google.com>
Fri, 23 Mar 2018 00:11:45 +0000 (17:11 -0700)
committerMinh Thai <mthai@google.com>
Fri, 23 Mar 2018 00:11:45 +0000 (17:11 -0700)
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 <mthai@google.com>
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsObjDatabase.java

index 42b1a479d8ee9330aff27de19531a4231dd98792..8e9ed5d0d86fd798d0d1683d1aa26578eb937aab 100644 (file)
@@ -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();