Browse Source

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 <mthai@google.com>
stable-5.0
Minh Thai 7 years ago
parent
commit
bf8057058e
  1. 2
      org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsObjDatabase.java

2
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();

Loading…
Cancel
Save