]> git.ipfire.org Git - thirdparty/git.git/commit
environment: move pager_program into repo_config_values
authorTian Yuchen <cat@malon.dev>
Tue, 14 Jul 2026 03:25:19 +0000 (11:25 +0800)
committerJunio C Hamano <gitster@pobox.com>
Tue, 14 Jul 2026 14:30:23 +0000 (07:30 -0700)
commite57125d804f29b8a6c70a47a03037cf31ef153d7
treea972a0767d19a2a0af9e8efe4765286dc6a47641
parent469e95c2573e938c0963ba52e8d06dd6aa7ba262
environment: move pager_program into repo_config_values

The 'pager_program' variable is currently defined as a file-scoped
static string in pager.c. Move it into 'struct repo_config_values'.

The configuration parsing logic remains strictly within pager.c to
respect subsystem boundaries. The read/write operations are simply
redirected to the repository-specific structure using
'repo_config_values()'. All current callers indeed pass
'the_repository', so this new enforcement does not harm them.

Similar to the recent editor_program migration, no standalone getter
is introduced to keep the code minimal. The dynamically allocated
memory is now managed by 'repo_config_values_clear()'.

On top of that, fix memory leaks in pager.c while we are at it.

Mentored-by: Christian Couder <christian.couder@gmail.com>
Mentored-by: Ayush Chandekar <ayu.chandekar@gmail.com>
Mentored-by: Olamide Caleb Bello <belkid98@gmail.com>
Signed-off-by: Tian Yuchen <cat@malon.dev>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
environment.c
environment.h
pager.c