public inbox for git@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] git.c: remove the_repository dependence in run_builtin()
@ 2025-06-12  4:59 Lidong Yan
  2025-06-12 17:16 ` Junio C Hamano
  2025-06-14  5:03 ` [PATCH v2] " Lidong Yan
  0 siblings, 2 replies; 16+ messages in thread
From: Lidong Yan @ 2025-06-12  4:59 UTC (permalink / raw)
  To: git; +Cc: christian.couder, shyamthakkar001, ayu.chandekar, Lidong Yan

run_builtin() takes a repo parameter, so the use of the_repository
is no longer necessary. Removed the usage of the_repository.

The comment before trace_repo_setup() advises not to use get_git_dir(),
but this note is unrelated to trace_repo_setup() itself. Additionally,
get_git_dir() has now been renamed to repo_get_git_dir(). Remove this
comment line.

Signed-off-by: Lidong Yan <502024330056@smail.nju.edu.cn>
---
 git.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/git.c b/git.c
index 77c4359522..429ad1c2fb 100644
--- a/git.c
+++ b/git.c
@@ -462,12 +462,11 @@ static int run_builtin(struct cmd_struct *p, int argc, const char **argv, struct
 	precompose_argv_prefix(argc, argv, NULL);
 	if (use_pager == -1 && run_setup &&
 		!(p->option & DELAY_PAGER_CONFIG))
-		use_pager = check_pager_config(the_repository, p->cmd);
+		use_pager = check_pager_config(repo, p->cmd);
 	if (use_pager == -1 && p->option & USE_PAGER)
 		use_pager = 1;
 	if (run_setup && startup_info->have_repository)
-		/* get_git_dir() may set up repo, avoid that */
-		trace_repo_setup(the_repository);
+		trace_repo_setup(repo);
 	commit_pager_choice();
 
 	if (!help && p->option & NEED_WORK_TREE)
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2025-06-16  6:22 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-12  4:59 [PATCH] git.c: remove the_repository dependence in run_builtin() Lidong Yan
2025-06-12 17:16 ` Junio C Hamano
2025-06-13  1:53   ` lidongyan
2025-06-13  4:49     ` Junio C Hamano
2025-06-14  5:03 ` [PATCH v2] " Lidong Yan
2025-06-14 23:35   ` Junio C Hamano
2025-06-15  1:49     ` Lidong Yan
2025-06-16  0:53       ` Junio C Hamano
2025-06-16  5:36         ` Lidong Yan
2025-06-16  5:41           ` Junio C Hamano
2025-06-15 14:46   ` [RFC PATCH v3 0/2] small fixes for git.c and setup.c Lidong Yan
2025-06-15 14:46     ` [PATCH v3 1/2] git.c: remove the_repository dependence in run_builtin() Lidong Yan
2025-06-15 14:46     ` [PATCH v3 2/2] setup: fix NEEDSWORK in setup_git_directory_gently() Lidong Yan
2025-06-16  1:25     ` [RFC PATCH v3 0/2] small fixes for git.c and setup.c Junio C Hamano
2025-06-16  1:36       ` Lidong Yan
2025-06-16  6:22     ` [PATCH v4] git.c: remove the_repository dependence in run_builtin() Lidong Yan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox