aboutsummaryrefslogtreecommitdiff
path: root/builtin/push.c
diff options
context:
space:
mode:
authorOlamide Caleb Bello <belkid98@gmail.com>2026-02-16 17:38:27 +0100
committerJunio C Hamano <gitster@pobox.com>2026-02-26 07:22:53 -0800
commitcf50830ce1d1b95a44f9d095ff868e7df1495863 (patch)
treecd822cab52c3abbc1685d3c5f3568c5e6dc5ac1e /builtin/push.c
parent4021751558126d39b642503e7ef4768131df45e7 (diff)
downloadgit-cf50830ce1d1b95a44f9d095ff868e7df1495863.tar.xz
environment: move "branch.autoSetupMerge" into `struct repo_config_values`
The config value `branch.autoSetupMerge` is parsed in `git_default_branch_config()` and stored in the global variable `git_branch_track`. This global variable can be overwritten by another repository when multiple Git repos run in the the same process. Move this value into `struct repo_config_values` in the_repository to retain current behaviours and move towards libifying Git. Since the variable is no longer a global variable, it has been renamed to `branch_track` in the struct `repo_config_values`. Suggested-by: Phillip Wood <phillip.wood123@gmail.com> Mentored-by: Christian Couder <christian.couder@gmail.com> Mentored-by: Usman Akinyemi <usmanakinyemi202@gmail.com> Signed-off-by: Olamide Caleb Bello <belkid98@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/push.c')
-rw-r--r--builtin/push.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/builtin/push.c b/builtin/push.c
index 5b6cebbb85..7100ffba5d 100644
--- a/builtin/push.c
+++ b/builtin/push.c
@@ -151,6 +151,7 @@ static NORETURN void die_push_simple(struct branch *branch,
const char *advice_pushdefault_maybe = "";
const char *advice_automergesimple_maybe = "";
const char *short_upstream = branch->merge[0]->src;
+ struct repo_config_values *cfg = repo_config_values(the_repository);
skip_prefix(short_upstream, "refs/heads/", &short_upstream);
@@ -162,7 +163,7 @@ static NORETURN void die_push_simple(struct branch *branch,
advice_pushdefault_maybe = _("\n"
"To choose either option permanently, "
"see push.default in 'git help config'.\n");
- if (git_branch_track != BRANCH_TRACK_SIMPLE)
+ if (cfg->branch_track != BRANCH_TRACK_SIMPLE)
advice_automergesimple_maybe = _("\n"
"To avoid automatically configuring "
"an upstream branch when its name\n"