Subject: Re: [PATCH 1/7] maintenance: optionally skip --auto process

From: Đoàn Trần Công Danh <[email-masked]>
Date: Thu, 20 Aug 2020 09:06:58 +0700

On 2020-08-19 17:16:42+0000, Derrick Stolee via GitGitGadget <[email-masked]> wrote:
> From: Derrick Stolee <[email-masked]>
> @@ -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