Set file name hashes

This commit is contained in:
Adam
2015-10-16 19:39:32 -04:00
parent c42617490d
commit 7e580f0f0b
2 changed files with 3 additions and 1 deletions

View File

@@ -560,6 +560,7 @@ public class Index implements Closeable
stream.writeInt(this.revision);
}
this.named = true;
stream.writeByte((this.named ? 1 : 0) | (this.usesWhirpool ? 2 : 0));
if (protocol >= 7)
{

View File

@@ -27,6 +27,7 @@ public class StoreTest
Index index = store.addIndex(0);
Archive archive = index.addArchive(0);
File file = archive.addFile(0);
file.setNameHash(7);
file.setContents("test".getBytes());
store.save();
@@ -54,7 +55,7 @@ public class StoreTest
for (int i = 0; i < NUMBER_OF_FILES; ++i)
{
File file = archive.addFile(i);
// file.setNameHash(random.nextInt());
file.setNameHash(random.nextInt());
byte[] data = new byte[random.nextInt(1024)];
random.nextBytes(data);
file.setContents(data);