diff options
author | Shawn Pearce <spearce@spearce.org> | 2017-07-18 19:30:07 -0700 |
---|---|---|
committer | Shawn Pearce <spearce@spearce.org> | 2017-07-19 09:01:43 -0400 |
commit | e6d9ae058b0d42c763b3c01374d7284e23a451c7 (patch) | |
tree | 9e6f798a0fbc7860a70b9ce6920eabf596ec9c48 /org.eclipse.jgit | |
parent | da7671fcd5593431c9a31c9e005565217b44fe10 (diff) | |
download | jgit-e6d9ae058b0d42c763b3c01374d7284e23a451c7.tar.gz jgit-e6d9ae058b0d42c763b3c01374d7284e23a451c7.zip |
dfs: only create DfsPackFile if description has PACK
In the future with reftable a DFS implementation may choose to create
a PackDescription that contains only a REFTABLE extension. Filter
these out by only creating a DfsPackFile if the PackDescription as the
expected PackExt.PACK.
Change-Id: I4c831622378156ae6b68f82c1ee1db5e150893be
Diffstat (limited to 'org.eclipse.jgit')
-rw-r--r-- | org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsObjDatabase.java | 5 |
1 files changed, 2 insertions, 3 deletions
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 891d9af2ea..76189c1615 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 @@ -464,7 +464,7 @@ public abstract class DfsObjDatabase extends ObjectDatabase { DfsPackFile oldPack = forReuse.remove(dsc); if (oldPack != null) { list.add(oldPack); - } else { + } else if (dsc.hasFileExt(PackExt.PACK)) { list.add(new DfsPackFile(cache, dsc)); foundNew = true; } @@ -482,8 +482,7 @@ public abstract class DfsObjDatabase extends ObjectDatabase { } private static Map<DfsPackDescription, DfsPackFile> reuseMap(PackList old) { - Map<DfsPackDescription, DfsPackFile> forReuse - = new HashMap<>(); + Map<DfsPackDescription, DfsPackFile> forReuse = new HashMap<>(); for (DfsPackFile p : old.packs) { if (p.invalid()) { // The pack instance is corrupted, and cannot be safely used |