Re: [PATCH v3 2/3] submodule--helper: teach config subcommand --unset

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Denton Liu <liu.denton@xxxxxxxxx> writes:

> +	if (argc == 3 || (argc == 2 && command == DO_UNSET)) {
>  		if (!is_writing_gitmodules_ok())
>  			die(_("please make sure that the .gitmodules file is in the working tree"));
>  
> -		return config_set_in_gitmodules_file_gently(argv[1], argv[2]);
> +		const char *value = (argc == 3) ? argv[2] : NULL;

This introduces decl-after-stmt.  Move it before the "is it OK to
write?" check.

> +		return config_set_in_gitmodules_file_gently(argv[1], value);
>  	}



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux