I’m stuck on the last Stage #MG6 while parsing Pack objects I get an inflation error after successfully parsing dozens or even over a hundred objects.
Failure is consistently in the same spot for a given repo. But otherwise no pattern I can determine - I’ve seen it fail for blob, tree & commit objects. My logic for deltified objects are also enough so I can carry on parsing, albeit incomplete. Typically no errors for extremely simple repos with short history.
Seems like I’m missing a special case. Help!
Exception below along with some logs that show previous objects were successfully parsed. Relevant code is probably around this area.
DEBUG org.howietkl.git.GitPack - processObjects objectIndex=103 type=BLOB size=51
DEBUG org.howietkl.git.GitPack - processObjects objectIndex=104 type=BLOB size=59
DEBUG org.howietkl.git.GitPack - processObjects objectIndex=105 type=BLOB size=32
DEBUG org.howietkl.git.GitPack - processObjects objectIndex=106 type=BLOB size=45
DEBUG org.howietkl.git.GitPack - processObjects objectIndex=107 type=TREE size=268
DEBUG org.howietkl.git.GitPack - processObjects objectIndex=108 type=BLOB size=5
java.util.zip.DataFormatException: incorrect header check
at java.base/java.util.zip.Inflater.inflateBytesBytes(Native Method)
at java.base/java.util.zip.Inflater.inflate(Inflater.java:400)
at java.base/java.util.zip.Inflater.inflate(Inflater.java:470)
at org.howietkl.git.utils.Utils.getInflated(Utils.java:44)
at org.howietkl.git.GitPack.processUndeltified(GitPack.java:142)
at org.howietkl.git.GitPack.processObject(GitPack.java:103)
at org.howietkl.git.GitPack.processObjects(GitPack.java:91)
at org.howietkl.git.GitPack.process(GitPack.java:73)
at org.howietkl.git.command.CloneCommand.gitClone(CloneCommand.java:37)
at org.howietkl.git.command.CloneCommand.execute(CloneCommand.java:21)
at Main.main(Main.java:24)
Things I’ve tried:
- Ruled out varint parsing by testing my lib against that of another challenger.