)]}'
{
  "commit": "c741c37a4a8eadb14a1073ea63c0806db9731b84",
  "tree": "c9c27b4e37391133fe95af7dcdcf15d9ec315d5b",
  "parents": [
    "b894a45c9d0c84a32f6b1d4f6333c708efccb0f8"
  ],
  "author": {
    "name": "Igor Wiedler",
    "email": "iwiedler@gitlab.com",
    "time": "Mon Oct 19 13:09:18 2026 +0200"
  },
  "committer": {
    "name": "Junio C Hamano",
    "email": "gitster@pobox.com",
    "time": "Mon Oct 19 16:07:05 2026 -0700"
  },
  "message": "odb: ignore refs of shallow and grafted alternates\n\nodb_for_each_alternate_ref() reports the refs of every alternate\nobject store that is a repository. Its three callers use them as\ncommits whose history can be assumed to be present: \"rev-list\n--alternate-refs\" (and through it the connectivity check after a\nfetch), fetch-pack, which sends them as \"have\"s so that the server\ndoes not resend what the alternate has, and receive-pack, which\nadvertises them as \".have\".\n\nThat assumption does not hold for a shallow repository, whose refs\npoint at commits with no history behind them below its shallow\nboundary, nor for a grafted one. A repository borrowing objects from\nsuch an alternate does not see the alternate\u0027s shallow file, so the\nhistory that is missing there is missing here as well. The fetch then\nsucceeds, the connectivity check stops at the alternate\u0027s refs, and\na later \"git log\" fails with \"Could not read \u003coid\u003e\".\n\n\"git clone --reference\" already rejects a shallow or grafted\nreference repository for this reason, but nothing prevents such a\nrepository from being added via objects/info/alternates or\nGIT_ALTERNATE_OBJECT_DIRECTORIES, or from being made shallow after\nother repositories started borrowing from it.\n\nSkip the refs of an alternate that has a \"shallow\" file or an\n\"info/grafts\" file, the same checks clone uses. Its objects are still\navailable through the object store. Only its refs are no longer used\nas a boundary.\n\nPartial clones have the same problem for the objects they lack, but\ndetecting one requires reading the alternate\u0027s config, so this\npatch does not handle them.\n\nHelped-by: Junio C Hamano \u003cgitster@pobox.com\u003e\nHelped-by: Jeff King \u003cpeff@peff.net\u003e\nSigned-off-by: Igor Wiedler \u003ciwiedler@gitlab.com\u003e\nSigned-off-by: Junio C Hamano \u003cgitster@pobox.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "eaee6ee8399c574d0a123b0eecba4b6b66422da4",
      "old_mode": 33188,
      "old_path": "Documentation/rev-list-options.adoc",
      "new_id": "6df0e536ad7ce67e316b9d6c92bf229b8c7365d4",
      "new_mode": 33188,
      "new_path": "Documentation/rev-list-options.adoc"
    },
    {
      "type": "modify",
      "old_id": "7d555be09feaea8932a7c58d02885d00f60a7234",
      "old_mode": 33188,
      "old_path": "odb.c",
      "new_id": "e431bcb84c80eda2e40b8a0055ce6d7f95f5ca6e",
      "new_mode": 33188,
      "new_path": "odb.c"
    },
    {
      "type": "modify",
      "old_id": "3c5fbef463eb01ae9a9ff0c53303d52c303995ff",
      "old_mode": 33261,
      "old_path": "t/t5618-alternate-refs.sh",
      "new_id": "68139a1b3e3810330b4bb868018ddf702389d13c",
      "new_mode": 33261,
      "new_path": "t/t5618-alternate-refs.sh"
    }
  ]
}
