aboutsummaryrefslogtreecommitdiffstats
path: root/builtin
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2025-04-29 14:21:27 -0700
committerJunio C Hamano <gitster@pobox.com>2025-04-29 14:21:27 -0700
commita501213402ec1bf298596f5c93ab21bf2a732bf0 (patch)
treeebf79bd08bae88e7fba8c6d3656b0a0312821f95 /builtin
parent8bb81ccfad03ee06a88b9acebba61823bd459999 (diff)
parentb502a648ef185e7e24ef80097330c44cca510264 (diff)
downloadgit-a501213402ec1bf298596f5c93ab21bf2a732bf0.tar.gz
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
Diffstat (limited to 'builtin')
-rw-r--r--builtin/add.c3
-rw-r--r--builtin/difftool.c3
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,