|
|
@ -96,6 +96,8 @@ public class PackFile implements Iterable<PackIndex.MutableEntry> { |
|
|
|
|
|
|
|
|
|
|
|
private final File packFile; |
|
|
|
private final File packFile; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private volatile String packName; |
|
|
|
|
|
|
|
|
|
|
|
final int hash; |
|
|
|
final int hash; |
|
|
|
|
|
|
|
|
|
|
|
private RandomAccessFile fd; |
|
|
|
private RandomAccessFile fd; |
|
|
@ -177,11 +179,15 @@ public class PackFile implements Iterable<PackIndex.MutableEntry> { |
|
|
|
|
|
|
|
|
|
|
|
/** @return name extracted from {@code pack-*.pack} pattern. */ |
|
|
|
/** @return name extracted from {@code pack-*.pack} pattern. */ |
|
|
|
public String getPackName() { |
|
|
|
public String getPackName() { |
|
|
|
String name = getPackFile().getName(); |
|
|
|
String name = packName; |
|
|
|
if (name.startsWith("pack-")) |
|
|
|
if (name == null) { |
|
|
|
name = name.substring("pack-".length()); |
|
|
|
name = getPackFile().getName(); |
|
|
|
if (name.endsWith(".pack")) |
|
|
|
if (name.startsWith("pack-")) |
|
|
|
name = name.substring(0, name.length() - ".pack".length()); |
|
|
|
name = name.substring("pack-".length()); |
|
|
|
|
|
|
|
if (name.endsWith(".pack")) |
|
|
|
|
|
|
|
name = name.substring(0, name.length() - ".pack".length()); |
|
|
|
|
|
|
|
packName = name; |
|
|
|
|
|
|
|
} |
|
|
|
return name; |
|
|
|
return name; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|