)]}'
{
  "commit": "602b2f0d450236a7e4d1b5bc1532a092b0a3129f",
  "tree": "d3369ea18399ec232d8338b0b3f9b10f4d050ee0",
  "parents": [
    "28a49925245df61f24b072727265a9eb530ab184"
  ],
  "author": {
    "name": "Roberto Tyley",
    "email": "roberto.tyley@guardian.co.uk",
    "time": "Thu Aug 25 22:25:10 2011 +0100"
  },
  "committer": {
    "name": "Roberto Tyley",
    "email": "roberto.tyley@guardian.co.uk",
    "time": "Thu Aug 25 22:25:10 2011 +0100"
  },
  "message": "Tolerate zlib deflation with window size \u003c 32Kb\n\nJGit currently identifies loose objects as \u0027corrupt\u0027 if they\u0027ve been\ndeflated using a window size less than 32Kb, because the\nisStandardFormat() function doesn\u0027t recognise the header\nbyte as a zlib header. This patch makes the method tolerant of\nall valid window sizes (15-bit to 8-bit) - but doesn\u0027t sacrifice\nit\u0027s accuracy in distingushing the standard loose-object format\nfrom the experimental (now abandoned) format. It\u0027s based on a patch\nwhich has been merged into C-Git master branch:\n\nhttps://github.com/git/git/commit/7f684a2aff636f44a506\n\nOn memory constrained systems zlib may use a much smaller window\nsize - working on Agit, I found that Android uses a 4KB window;\ngiving a header byte of 0x48, not 0x78. Consequently all loose\nobjects generated by the Android platform appear \u0027corrupt\u0027 :(\n\nIt might appear that this patch changes isStandardFormat() to the\npoint where it could incorrectly identify the experimental format as\nthe standard one, but the two criteria (bitmask \u0026 checksum) can only\ngive a false result for an experimental object where both of the\nfollowing are true:\n\n1) object size is exactly 8 bytes when uncompressed (bitmask)\n2) [single-byte in-pack git type\u0026size header] * 256\n   + [1st byte of the following zlib header] % 31 \u003d 0 (checksum)\n\nAs it happens, for all possible combinations of valid object type\n(1-4) and window bits (0-7), the only time when the checksum will be\ndivisible by 31 is for 0x1838 - ie object type *1*, a Commit - which,\ndue the fields all Commit objects must contain, could never be as\nsmall as 8 bytes in size.\n\nGiven this, the combination of the two criteria (bitmask \u0026 checksum)\nalways correctly determines the buffer format, and is more tolerant\nthan the previous version.\n\nReferences:\n\nAndroid uses a 4KB window for deflation:\nhttp://android.git.kernel.org/?p\u003dplatform/libcore.git;a\u003dblob;f\u003dluni/src/main/native/java_util_zip_Deflater.cpp;h\u003dc0b2feff196e63a7b85d97cf9ae5bb2583409c28;hb\u003drefs/heads/gingerbread#l53\n\nCode snippet searching for false positives with the zlib checksum:\nhttps://gist.github.com/1118177\n\nChange-Id: Ifd84cd2bd6b46f087c9984fb4cbd8309f483dec0\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "b04a294b63914a2bb04b764644f8b18a0667d61b",
      "old_mode": 33188,
      "old_path": "org.eclipse.jgit/src/org/eclipse/jgit/storage/file/UnpackedObject.java",
      "new_id": "de38caa231ac89ab287c62d95b80a37e60688c9f",
      "new_mode": 33188,
      "new_path": "org.eclipse.jgit/src/org/eclipse/jgit/storage/file/UnpackedObject.java"
    }
  ]
}
