Merge branch 'ua/call-repo-config-with-possibly-null-repository'

Since a call to repo_config() can be called with repo set to NULL
these days, a command that is marked as RUN_SETUP in the builtin
command table does not have to check repo with NULL before making
the call.

* ua/call-repo-config-with-possibly-null-repository:
  builtin/difftool: remove unnecessary if statement
  builtin/add: remove unnecessary if statement
main
Junio C Hamano 2025-04-29 14:21:27 -07:00
commit a501213402
2 changed files with 2 additions and 4 deletions

View 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);

View File

@ -753,8 +753,7 @@ int cmd_difftool(int argc,
};
struct child_process child = CHILD_PROCESS_INIT;

if (repo)
repo_config(repo, difftool_config, &dt_options);
repo_config(repo, difftool_config, &dt_options);
dt_options.symlinks = dt_options.has_symlinks;

argc = parse_options(argc, argv, prefix, builtin_difftool_options,