From 2e4e439ec27c1d14f205bdd3cceb51b30c5d6d74 Mon Sep 17 00:00:00 2001 From: Usman Akinyemi Date: Sun, 20 Apr 2025 08:24:32 +0530 Subject: [PATCH] builtin/add: remove unnecessary if statement Since we already teach the `repo_config()` in "f29f1990b5 (config: teach repo_config to allow `repo` to be NULL, 2025-03-08)" to allow `repo` to be NULL, no need to check if `repo` is NULL before calling `repo_config()`. Suggested-by: Patrick Steinhardt Mentored-by: Christian Couder Signed-off-by: Usman Akinyemi Signed-off-by: Junio C Hamano --- builtin/add.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/builtin/add.c b/builtin/add.c index 78dfb26577..747511b68b 100644 --- a/builtin/add.c +++ b/builtin/add.c @@ -386,8 +386,7 @@ int cmd_add(int argc, char *ps_matched = NULL; struct lock_file lock_file = LOCK_INIT; - if (repo) - repo_config(repo, add_config, NULL); + repo_config(repo, add_config, NULL); argc = parse_options(argc, argv, prefix, builtin_add_options, builtin_add_usage, PARSE_OPT_KEEP_ARGV0); -- 2.39.5