)]}'
{
  "commit": "e66077ae45813a5ca269a7d676310a243bdcc1c2",
  "tree": "7ab314117a25175709c90b6e9d1fa37bdae596b5",
  "parents": [
    "6ec4c0b45ba916770c6fbc03df94018ca06fb77e"
  ],
  "author": {
    "name": "Patrick Steinhardt",
    "email": "ps@pks.im",
    "time": "Thu Oct 23 09:16:22 2025 +0200"
  },
  "committer": {
    "name": "Junio C Hamano",
    "email": "gitster@pobox.com",
    "time": "Tue Nov 04 07:32:25 2025 -0800"
  },
  "message": "ref-filter: detect broken tags when dereferencing them\n\nUsers can ask git-for-each-ref(1) to peel tags and return information of\nthe tagged object by adding an asterisk to the format, like for example\n\"%(*$objectname)\". If so, git-for-each-ref(1) peels that object to the\nfirst non-tag object and then returns its values.\n\nAs mentioned in preceding commits, it can happen that the tagged object\ntype and the claimed object type differ, effectively resulting in a\ncorrupt tag. git-for-each-ref(1) would notice this mismatch, print an\nerror and then bail out when trying to peel the tag.\n\nBut we only notice this corruption in some very specific edge cases!\nWhile we have a test in \"t/for-each-ref-tests.sh\" that verifies the\nabove scenario, this test is specifically crafted to detect the issue at\nhand. Namely, we create two tags:\n\n  - One tag points to a specific object with the correct type.\n\n  - The other tag points to the *same* object with a different type.\n\nThe fact that both tags point to the same object is important here:\n`peel_object()` wouldn\u0027t notice the corruption if the tagged objects\nwere different.\n\nThe root cause is that `peel_object()` calls `lookup_${type}()`\neventually, where the type is the same type declared in the tag object.\nConsequently, when we have two tags pointing to the same object but with\ndifferent declared types we\u0027ll call two different lookup functions. The\nfirst lookup will store the object with an unverified type A, whereas\nthe second lookup will try to look up the object with a different\nunverified type B. And it is only now that we notice the discrepancy in\nobject types, even though type A could\u0027ve already been the wrong type.\n\nFix the issue by verifying the object type in `populate_value()`. With\nthis change we\u0027ll also notice type mismatches when only dereferencing a\ntag once.\n\nSigned-off-by: Patrick Steinhardt \u003cps@pks.im\u003e\nSigned-off-by: Junio C Hamano \u003cgitster@pobox.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "9a8ed8c8fc1f3b6bccb4ff8fe5a9123e43c1d9db",
      "old_mode": 33188,
      "old_path": "ref-filter.c",
      "new_id": "c54025d6b4c4cd2fd227fb3b690854635ccea025",
      "new_mode": 33188,
      "new_path": "ref-filter.c"
    },
    {
      "type": "modify",
      "old_id": "e3ad19298accdeeb393b65fceb9e6bf97541cc8b",
      "old_mode": 33188,
      "old_path": "t/for-each-ref-tests.sh",
      "new_id": "4593be5fd544a8359d458302b3807d6afee7b2de",
      "new_mode": 33188,
      "new_path": "t/for-each-ref-tests.sh"
    }
  ]
}
