Skip to content

Commit 2e4e439

Browse files
Unique-Usmangitster
authored andcommitted
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 <[email protected]> Mentored-by: Christian Couder <[email protected]> Signed-off-by: Usman Akinyemi <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 1a764cd commit 2e4e439

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

builtin/add.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -386,8 +386,7 @@ int cmd_add(int argc,
386386
char *ps_matched = NULL;
387387
struct lock_file lock_file = LOCK_INIT;
388388

389-
if (repo)
390-
repo_config(repo, add_config, NULL);
389+
repo_config(repo, add_config, NULL);
391390

392391
argc = parse_options(argc, argv, prefix, builtin_add_options,
393392
builtin_add_usage, PARSE_OPT_KEEP_ARGV0);

0 commit comments

Comments
 (0)