summaryrefslogtreecommitdiff
path: root/builtin/commit.c
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2024-05-27 13:46:30 +0200
committerJunio C Hamano <gitster@pobox.com>2024-05-27 11:19:59 -0700
commit106a54aecb21fb17956290aee4e9204aa29174e7 (patch)
tree295cb10632043754ffb3ab8ccd2c8e0e361e6ae7 /builtin/commit.c
parenta6cb0cc61033d10eb948057c45dea25c1ab8e151 (diff)
builtin/log: stop using globals for log config
We're using global variables to store the log configuration. Many of these can be set both via the command line and via the config, and depending on how they are being set, they may contain allocated strings. This leads to hard-to-track memory ownership and memory leaks. Refactor the code to instead use a `struct log_config` that is being allocated on the stack. This allows us to more clearly scope the variables, track memory ownership and ultimately release the memory. This also prepares us for a change to `git_config_string()`, which will be adapted to have a `char **` out parameter instead of `const char **`. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/commit.c')
0 files changed, 0 insertions, 0 deletions