Re: [PATCH 1/7] maintenance: optionally skip --auto process
- From
Đoàn Trần Công Danh <congdanhqx@gmail.com>
- Date
- Aug 20, 2020, 02:06 UTC
- Message-ID
- <20200820020658.GA31084@danh.dev>
- In-Reply-To
- <90de25d1287595fdedc9dcd194a2e0ac120d4aad.1597857409.git.gitgitgadget@gmail.com>
On 2020-08-19 17:16:42+0000, Derrick Stolee via GitGitGadget <gitgitgadget@gmail.com> wrote:
Show 13 quoted lines
> From: Derrick Stolee <dstolee@microsoft.com>
> @@ -1868,8 +1869,15 @@ int run_processes_parallel_tr2(int n, get_next_task_fn get_next_task,
>
> int run_auto_maintenance(int quiet)
> {
> + int enabled;
> struct child_process maint = CHILD_PROCESS_INIT;
>
> + if (!git_config_get_bool("maintenance.auto", &enabled) &&
> + !enabled) {
> + fprintf(stderr, "enabled: %d\n", enabled);
> + return 0;
> + }Nit: This block of code is mis-indented (mixed space and tab).
If we're running into inner block, "enabled" will always be "0" We can just write:
fprintf(stderr, "enabled: 0\n");
instead. Writing like that, we have one less thing to worry about (whether "enabled" is initialised in git_config_get_bool or not).
-- Danh