[PATCH] fixup! clone: set submodule.recurse=true if submodule.stickyRecursiveClone enabled

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

 



Narrow the scope of a temporary variable used only once and
immediately die, and rename it to a shorter, throw-away name.

Also lose a {} around a single statement block.

Signed-off-by: Junio C Hamano <gitster@xxxxxxxxx>
---

 * To be squashed into mk/clone-recurse-submodules topic 1a0e8231
   (clone: set submodule.recurse=true if
   submodule.stickyRecursiveClone enabled, 2021-08-14)

 builtin/clone.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/builtin/clone.c b/builtin/clone.c
index a08d901224..9c0c68a8ef 100644
--- a/builtin/clone.c
+++ b/builtin/clone.c
@@ -986,7 +986,6 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
 	struct remote *remote;
 	int err = 0, complete_refs_before_fetch = 1;
 	int submodule_progress;
-	int sticky_recursive_clone;
 
 	struct transport_ls_refs_options transport_ls_refs_options =
 		TRANSPORT_LS_REFS_OPTIONS_INIT;
@@ -1115,6 +1114,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
 	if (option_recurse_submodules.nr > 0) {
 		struct string_list_item *item;
 		struct strbuf sb = STRBUF_INIT;
+		int val;
 
 		/* remove duplicates */
 		string_list_sort(&option_recurse_submodules);
@@ -1131,10 +1131,9 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
 					   strbuf_detach(&sb, NULL));
 		}
 
-		if (!git_config_get_bool("submodule.stickyRecursiveClone", &sticky_recursive_clone)
-		    && sticky_recursive_clone) {
-		    string_list_append(&option_config, "submodule.recurse=true");
-		}
+		if (!git_config_get_bool("submodule.stickyRecursiveClone", &val) &&
+		    val)
+			string_list_append(&option_config, "submodule.recurse=true");
 
 		if (option_required_reference.nr &&
 		    option_optional_reference.nr)
-- 
2.33.0-204-gff69670db4




[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