)]}'
{
  "commit": "282a8a38304f308b5d6e7ad2fea9a814bb6a2979",
  "tree": "4f475fd37360c3ec6ab66df5baae7157e7d366dd",
  "parents": [
    "80573f3b938c33796389fd0e72edda8a0f07b566"
  ],
  "author": {
    "name": "David Ostrovsky",
    "email": "david@ostrovsky.org",
    "time": "Fri Nov 13 09:39:18 2026 +0100"
  },
  "committer": {
    "name": "David Ostrovsky",
    "email": "david@ostrovsky.org",
    "time": "Sat Nov 14 10:54:01 2026 +0100"
  },
  "message": "FetchHeadRecord: skip a record with an unsafe source name\n\nA hostile remote can advertise a ref name containing control characters\n(e.g. a newline). JGit\u0027s advertisement parser accepts such a name, and\nFetchHeadRecord.write() wrote it verbatim into the line-based FETCH_HEAD\nfile, so a newline could forge a spurious \"\u003csha\u003e branch \u0027...\u0027 of ...\"\nentry that downstream tooling (git merge FETCH_HEAD) would treat as a\nreal merge candidate.\n\nThe preceding change validates fetch destinations, which blocks this on\nthe wildcard and tag-following paths, but an explicit-destination fetch\nsuch as \u003cadvertised-name\u003e:FETCH_HEAD feeds the advertised source name\ninto the FETCH_HEAD content unchecked.\n\nNative git relies on the wire layer never producing a ref name with a\nnewline and writes the name unescaped (it only escapes a newline in the\nURL). JGit cannot make that assumption, so reject a source name that\ncontains a control character or space.\n\nMake write() report whether it emitted a record and refuse an unsafe\nname. The caller skips result.add for a refused record and warns, like\nnative git\u0027s \"Ignoring funny ref\", with the dropped name escaped so it\ncannot itself forge a log line.\n\nAdd a test that write() returns false and emits nothing for a source\nname carrying a newline and a forged tail.\n\nChange-Id: I1da7cfe6adb684880c3dcd41960d2ae0474f82bd\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "af2a91a132eca92060c69fd417a39c5a895626d4",
      "old_mode": 33188,
      "old_path": "org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/FetchMaliciousRefNameTest.java",
      "new_id": "933a1a3710eba785abb4799abfd84602385b61ed",
      "new_mode": 33188,
      "new_path": "org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/FetchMaliciousRefNameTest.java"
    },
    {
      "type": "modify",
      "old_id": "ffb011cb8b5c105c108fe9113eacef17813ef588",
      "old_mode": 33188,
      "old_path": "org.eclipse.jgit/src/org/eclipse/jgit/transport/FetchHeadRecord.java",
      "new_id": "34288fa86f28b4a1124099457550a679d0403dc1",
      "new_mode": 33188,
      "new_path": "org.eclipse.jgit/src/org/eclipse/jgit/transport/FetchHeadRecord.java"
    },
    {
      "type": "modify",
      "old_id": "b743611f4b1a983e7febac8cdde4f0093a32bcd7",
      "old_mode": 33188,
      "old_path": "org.eclipse.jgit/src/org/eclipse/jgit/transport/FetchProcess.java",
      "new_id": "99cde35155fd642cac9da6f865819c9f57ce06c1",
      "new_mode": 33188,
      "new_path": "org.eclipse.jgit/src/org/eclipse/jgit/transport/FetchProcess.java"
    }
  ]
}
