summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit
diff options
context:
space:
mode:
authorShawn O. Pearce <spearce@spearce.org>2010-08-25 16:46:43 -0700
committerShawn O. Pearce <spearce@spearce.org>2010-08-25 17:07:13 -0700
commit7a9edb3662a4345573752b5a77710b6d2b28e7fa (patch)
treeb0239644be3014218bf3f6e4faec7d248850812f /org.eclipse.jgit
parent3a972f86648ccae976c8f6d6f6521be37c8fead1 (diff)
downloadjgit-7a9edb3662a4345573752b5a77710b6d2b28e7fa.tar.gz
jgit-7a9edb3662a4345573752b5a77710b6d2b28e7fa.zip
Fix reuse from pack file for REF_DELTA types
We miscomputed the CRC32 checksum for a REF_DELTA type of object, by not including the full 20 byte ObjectId of the delta base in the CRC code we use when the delta is too large to go through our two faster small reuse code paths. This resulted in a corruption error during packing, where the PackFile erroneously suspected the data was wrong on the local filesystem and aborted writing, because the CRC didn't match what we had read from the index. Change-Id: I7d12cdaeaf2c83ddc11223ce0108d9bd6886e025 Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Diffstat (limited to 'org.eclipse.jgit')
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/storage/file/PackFile.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/storage/file/PackFile.java b/org.eclipse.jgit/src/org/eclipse/jgit/storage/file/PackFile.java
index 99637ee617..ed159ef389 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/storage/file/PackFile.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/storage/file/PackFile.java
@@ -334,7 +334,7 @@ public class PackFile implements Iterable<PackIndex.MutableEntry> {
readFully(src.offset + headerCnt, buf, 0, 20, curs);
crc1.update(buf, 0, 20);
- crc2.update(buf, 0, headerCnt);
+ crc2.update(buf, 0, 20);
headerCnt += 20;
} else {
crc1.update(buf, 0, headerCnt);