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>
main
Usman Akinyemi 2025-04-20 08:24:32 +05:30 committed by Junio C Hamano
parent 1a764cdbdc
commit 2e4e439ec2
1 changed files with 1 additions and 2 deletions

View File

@ -386,8 +386,7 @@ int cmd_add(int argc,
char *ps_matched = NULL; char *ps_matched = NULL;
struct lock_file lock_file = LOCK_INIT; 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, argc = parse_options(argc, argv, prefix, builtin_add_options,
builtin_add_usage, PARSE_OPT_KEEP_ARGV0); builtin_add_usage, PARSE_OPT_KEEP_ARGV0);