{"thread":{"id":"63314","subject":"[PATCH 0/2] remove unnecessary if statement","startedAt":"2025-04-20T02:55:08Z","lastAt":"2025-04-20T02:55:15Z","messageCount":3,"participants":["Usman Akinyemi"],"isPatch":true,"patchVersion":1,"patchTotal":2},"messages":[{"id":"516394","messageId":"20250420025501.183290-1-usmanakinyemi202@gmail.com","threadId":"63314","inReplyTo":null,"subject":"[PATCH 0/2] remove unnecessary if statement","fromName":"Usman Akinyemi","fromEmail":"usmanakinyemi202@gmail.com","sentAt":"2025-04-20T02:54:31Z","receivedAt":"2025-04-20T02:55:08Z","isPatch":true,"sender":{"key":"usmanakinyemi202@gmail.com","avatar":"https://avatars.githubusercontent.com/u/86585626?v=4"},"body":"Since we already teach the `repo_config()` in \"f29f1990b5\n(config: teach repo_config to allow `repo` to be NULL, 2025-03-08)\"\nto allow `repo` to be NULL, no need to check if `repo` is NULL\nbefore calling `repo_config()`.\n\nThis was suggested by Patrick Steinhardt <ps@pks.im>\n\nUsman Akinyemi (2):\n  builtin/add: remove unnecessary if statement\n  builtin/difftool: remove unnecessary if statement\n\n builtin/add.c      | 3 +--\n builtin/difftool.c | 3 +--\n 2 files changed, 2 insertions(+), 4 deletions(-)\n\n-- \n2.49.0\n\n"},{"id":"516395","messageId":"20250420025501.183290-2-usmanakinyemi202@gmail.com","threadId":"63314","inReplyTo":"20250420025501.183290-1-usmanakinyemi202@gmail.com","subject":"[PATCH 1/2] builtin/add: remove unnecessary if statement","fromName":"Usman Akinyemi","fromEmail":"usmanakinyemi202@gmail.com","sentAt":"2025-04-20T02:54:32Z","receivedAt":"2025-04-20T02:55:11Z","isPatch":true,"sender":{"key":"usmanakinyemi202@gmail.com","avatar":"https://avatars.githubusercontent.com/u/86585626?v=4"},"body":"Since we already teach the `repo_config()` in \"f29f1990b5\n(config: teach repo_config to allow `repo` to be NULL, 2025-03-08)\"\nto allow `repo` to be NULL, no need to check if `repo` is NULL\nbefore calling `repo_config()`.\n\nSuggested-by: Patrick Steinhardt <ps@pks.im>\nMentored-by: Christian Couder <chriscool@tuxfamily.org>\nSigned-off-by: Usman Akinyemi <usmanakinyemi202@gmail.com>\n---\n builtin/add.c | 3 +--\n 1 file changed, 1 insertion(+), 2 deletions(-)\n\ndiff --git a/builtin/add.c b/builtin/add.c\nindex 78dfb26577..747511b68b 100644\n--- a/builtin/add.c\n+++ b/builtin/add.c\n@@ -386,8 +386,7 @@ int cmd_add(int argc,\n \tchar *ps_matched = NULL;\n \tstruct lock_file lock_file = LOCK_INIT;\n \n-\tif (repo)\n-\t\trepo_config(repo, add_config, NULL);\n+\trepo_config(repo, add_config, NULL);\n \n \targc = parse_options(argc, argv, prefix, builtin_add_options,\n \t\t\t  builtin_add_usage, PARSE_OPT_KEEP_ARGV0);\n-- \n2.49.0\n\n"},{"id":"516396","messageId":"20250420025501.183290-3-usmanakinyemi202@gmail.com","threadId":"63314","inReplyTo":"20250420025501.183290-1-usmanakinyemi202@gmail.com","subject":"[PATCH 2/2] builtin/difftool: remove unnecessary if statement","fromName":"Usman Akinyemi","fromEmail":"usmanakinyemi202@gmail.com","sentAt":"2025-04-20T02:54:33Z","receivedAt":"2025-04-20T02:55:15Z","isPatch":true,"sender":{"key":"usmanakinyemi202@gmail.com","avatar":"https://avatars.githubusercontent.com/u/86585626?v=4"},"body":"Since we already teach the `repo_config()` in \"f29f1990b5\n(config: teach repo_config to allow `repo` to be NULL, 2025-03-08)\"\nto allow `repo` to be NULL, no need to check if `repo` is NULL\nbefore calling `repo_config()`.\n\nSuggested-by: Patrick Steinhardt <ps@pks.im>\nMentored-by: Christian Couder <chriscool@tuxfamily.org>\nSigned-off-by: Usman Akinyemi <usmanakinyemi202@gmail.com>\n---\n builtin/difftool.c | 3 +--\n 1 file changed, 1 insertion(+), 2 deletions(-)\n\ndiff --git a/builtin/difftool.c b/builtin/difftool.c\nindex 41cd00066c..c7348a1dca 100644\n--- a/builtin/difftool.c\n+++ b/builtin/difftool.c\n@@ -750,8 +750,7 @@ int cmd_difftool(int argc,\n \t};\n \tstruct child_process child = CHILD_PROCESS_INIT;\n \n-\tif (repo)\n-\t\trepo_config(repo, difftool_config, &dt_options);\n+\trepo_config(repo, difftool_config, &dt_options);\n \tdt_options.symlinks = dt_options.has_symlinks;\n \n \targc = parse_options(argc, argv, prefix, builtin_difftool_options,\n-- \n2.49.0\n\n"}]}