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 <ps@pks.im> Mentored-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Usman Akinyemi <usmanakinyemi202@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Usman Akinyemi committed Apr 20, 2025 at 08:24 UTC 2e4e439ec27c1d14f205bdd3cceb51b30c5d6d74
1 file changed +1 -2
builtin/add.c
+1 -2
@@ -386,8 +386,7 @@ int cmd_add(int argc,
386 char *ps_matched = NULL;
387 struct lock_file lock_file = LOCK_INIT;
388
389 - if (repo)
390 - repo_config(repo, add_config, NULL);
389 + repo_config(repo, add_config, NULL);
390
391 argc = parse_options(argc, argv, prefix, builtin_add_options,
392 builtin_add_usage, PARSE_OPT_KEEP_ARGV0);