Thread (1 message) 1 message, 1 author, 2019-02-07

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

From: Junio C Hamano <hidden>
Date: 2019-02-07 22:29:26

Denton Liu [off-list ref] 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);
 	}
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help