)]}'
{
  "commit": "e5256c82e569694c64adbbe4c1bef12bbba94f30",
  "tree": "3e55496dc0b45b180470eba5d9b17bf3960a94a1",
  "parents": [
    "6c18d03eb833bb76d0072373bd064e469a022d4f"
  ],
  "author": {
    "name": "Patrick Steinhardt",
    "email": "ps@pks.im",
    "time": "Fri Aug 07 09:05:58 2020 +0200"
  },
  "committer": {
    "name": "Junio C Hamano",
    "email": "gitster@pobox.com",
    "time": "Fri Aug 07 12:27:41 2020 -0700"
  },
  "message": "refs: fix interleaving hook calls with reference-transaction hook\n\nIn order to not repeatedly search for the reference-transaction hook in\ncase it\u0027s getting called multiple times, we use a caching mechanism to\nonly call `find_hook()` once. What was missed though is that the return\nvalue of `find_hook()` actually comes from a static strbuf, which means\nit will get overwritten when calling `find_hook()` again. As a result,\nwe may call the wrong hook with parameters of the reference-transaction\nhook.\n\nThis scenario was spotted in the wild when executing a git-push(1) with\nmultiple references, where there are interleaving calls to both the\nupdate and the reference-transaction hook. While initial calls to the\nreference-transaction hook work as expected, it will stop working after\nthe next invocation of the update hook. The result is that we now start\ncalling the update hook with parameters and stdin of the\nreference-transaction hook.\n\nThis commit fixes the issue by storing a copy of `find_hook()`\u0027s return\nvalue in the cache.\n\nSigned-off-by: Junio C Hamano \u003cgitster@pobox.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "f05295f50300b6ce7261fa65c6a9e0af221a20b3",
      "old_mode": 33188,
      "old_path": "refs.c",
      "new_id": "836d49b9588dfc5e7eafe908654f02b4aaf93607",
      "new_mode": 33188,
      "new_path": "refs.c"
    },
    {
      "type": "modify",
      "old_id": "da58d867a56f57360c7090bced0911350bc5fef0",
      "old_mode": 33261,
      "old_path": "t/t1416-ref-transaction-hooks.sh",
      "new_id": "d4d19194bfb93683385d4b12c132cbe9d804acb8",
      "new_mode": 33261,
      "new_path": "t/t1416-ref-transaction-hooks.sh"
    }
  ]
}
