]> git.ipfire.org Git - thirdparty/git.git/commit
builtin/merge: always store allocated strings in `pull_twohead`
authorPatrick Steinhardt <ps@pks.im>
Fri, 7 Jun 2024 06:39:35 +0000 (08:39 +0200)
committerJunio C Hamano <gitster@pobox.com>
Fri, 7 Jun 2024 17:30:56 +0000 (10:30 -0700)
commit71e01a0ebd50fed1d494e1b05374ec0977437248
treec78bb9774659a59a53286fe545c21f2aef0d1292
parentfc066767662ead1b279a20545ff02ab17d835f34
builtin/merge: always store allocated strings in `pull_twohead`

The `pull_twohead` configuration may sometimes contain an allocated
string, and sometimes it may contain a string constant. Refactor this to
instead always store an allocated string such that we can release its
resources without risk.

While at it, manage the lifetime of other config strings, as well. Note
that we explicitly don't free `cleanup_arg` here. This is because the
variable may be assigned a string constant via command line options.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/merge.c