ObjectDirectory: Remove last modified check in insertPack

GC explicitly handles the case where a new pack has the same name as an
existing pack due to it containing the exact same set of objects. In
this case, the pack passed to insertPack will have the same name as an
existing pack, but it will also almost certainly have a later mtime than
the existing pack.

The loop in insertPack tried to short-circuit when inserting a new pack,
to avoid walking more of the pack list than necessary. Unfortunately,
this means it will never get to the check for an identical name,
resulting in a duplicate entry for the same PackFile in the pack list.
Remove the short-circuit so that insertPack does not insert a duplicate
entry.

Change-Id: I00711b28594622ad3bd104332334e8a3592cda7f
This commit is contained in:
Dave Borowitz 2017-11-01 10:19:38 -04:00
parent e1a39cbbe7
commit 5b5c3a2e1d
1 changed files with 0 additions and 2 deletions

View File

@ -814,8 +814,6 @@ private void insertPack(final PackFile pf) {
final PackFile[] oldList = o.packs;
final String name = pf.getPackFile().getName();
for (PackFile p : oldList) {
if (PackFile.SORT.compare(pf, p) < 0)
break;
if (name.equals(p.getPackFile().getName()))
return;
}