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

The global variable 'push_default' specifies the default behavior of
'git push' when no explicit refspec is provided. Move 'push_default'
into 'struct repo_config_values' to continue the libification effort.

While 'enum push_default_type' ideally belongs in 'remote.h', moving it
there introduces a circular dependency chain:

  remote.h -> hash.h -> repository.h -> environment.h.

Therefore, the enum definition is kept in 'environment.h' just above
'struct repo_config_values' with a NEEDSWORK comment for future cleanup.

Modify the configuration parsing in environment.c to update the
per-repository structure directly, and update caller across the
codebase to access the value via 'repo_config_values()'.

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>
builtin/push.c
environment.c
environment.h
remote.c