summaryrefslogtreecommitdiffstats
path: root/contrib/persistent-https
diff options
context:
space:
mode:
authorAdrian Ratiu <adrian.ratiu@collabora.com>2026-02-19 00:23:45 +0200
committerJunio C Hamano <gitster@pobox.com>2026-02-19 13:23:40 -0800
commitee2fbfd6b28fba20bc936ad1c2cb2617ba251025 (patch)
treeb956dd564d34592160e4ee9a507d2b15138b9fd0 /contrib/persistent-https
parent468b5f75c3e277d84e2d739e642fbad27ccdb666 (diff)
downloadgit-ee2fbfd6b28fba20bc936ad1c2cb2617ba251025.tar.gz
git-ee2fbfd6b28fba20bc936ad1c2cb2617ba251025.zip
hook: add internal state alloc/free callbacks
Some hooks use opaque structs to keep internal state between callbacks. Because hooks ran sequentially (jobs == 1) with one command per hook, these internal states could be allocated on the stack for each hook run. Next commits add the ability to run multiple commands for each hook, so the states cannot be shared or stored on the stack anymore, especially since down the line we will also enable parallel execution (jobs > 1). Add alloc/free helpers for each hook, doing a "deep" alloc/init & free of their internal opaque struct. The alloc callback takes a context pointer, to initialize the struct at at the time of resource acquisition. These callbacks must always be provided together: no alloc without free and no free without alloc, otherwise a BUG() is triggered. Signed-off-by: Adrian Ratiu <adrian.ratiu@collabora.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'contrib/persistent-https')
0 files changed, 0 insertions, 0 deletions