Skip to content

Commit a501213

Browse files
committed
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
2 parents 8bb81cc + b502a64 commit a501213

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
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);

builtin/difftool.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -753,8 +753,7 @@ int cmd_difftool(int argc,
753753
};
754754
struct child_process child = CHILD_PROCESS_INIT;
755755

756-
if (repo)
757-
repo_config(repo, difftool_config, &dt_options);
756+
repo_config(repo, difftool_config, &dt_options);
758757
dt_options.symlinks = dt_options.has_symlinks;
759758

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

0 commit comments

Comments
 (0)