diff options
| author | Junio C Hamano <gitster@pobox.com> | 2025-04-29 14:21:27 -0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2025-04-29 14:21:27 -0700 |
| commit | a501213402ec1bf298596f5c93ab21bf2a732bf0 (patch) | |
| tree | ebf79bd08bae88e7fba8c6d3656b0a0312821f95 | |
| parent | Merge branch 'js/git-perf-env-override' (diff) | |
| parent | builtin/difftool: remove unnecessary if statement (diff) | |
| download | git-a501213402ec1bf298596f5c93ab21bf2a732bf0.tar.gz git-a501213402ec1bf298596f5c93ab21bf2a732bf0.zip | |
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
| -rw-r--r-- | builtin/add.c | 3 | ||||
| -rw-r--r-- | builtin/difftool.c | 3 |
2 files changed, 2 insertions, 4 deletions
diff --git a/builtin/add.c b/builtin/add.c index 78dfb26577..747511b68b 100644 --- a/builtin/add.c +++ b/builtin/add.c @@ -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); diff --git a/builtin/difftool.c b/builtin/difftool.c index f17a55b3cf..a3b64ce694 100644 --- a/builtin/difftool.c +++ b/builtin/difftool.c @@ -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, |
