]> git.ipfire.org Git - thirdparty/git.git/commitdiff
builtin/add: remove unnecessary if statement
authorUsman Akinyemi <usmanakinyemi202@gmail.com>
Sun, 20 Apr 2025 02:54:32 +0000 (08:24 +0530)
committerJunio C Hamano <gitster@pobox.com>
Sun, 20 Apr 2025 21:17:20 +0000 (14:17 -0700)
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>
builtin/add.c

index 78dfb265776724109f4a8b93a419c32667979954..747511b68bc310f1f1f13c13f7e8dd212ab53186 100644 (file)
@@ -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);