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

Subsystems: the rest

STALE1798d

3 messages, 2 authors, 2021-08-30 · open the first message on its own page

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

From: Junio C Hamano <hidden>
Date: 2021-08-18 20:16:03

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 <redacted>
---

 * 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

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

From: Emily Shaffer <hidden>
Date: 2021-08-19 17:41:14

On Wed, Aug 18, 2021 at 01:15:56PM -0700, Junio C Hamano wrote:
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 <redacted>
Acked-by: Emily Shaffer <redacted>

Thanks.

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

From: Emily Shaffer <hidden>
Date: 2021-08-30 20:59:12

On Thu, Aug 19, 2021 at 10:41:03AM -0700, Emily Shaffer wrote:
On Wed, Aug 18, 2021 at 01:15:56PM -0700, Junio C Hamano wrote:
quoted
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 <redacted>
Acked-by: Emily Shaffer <redacted>

Thanks.
Having not heard from Mahi last week, if you are happy with the
patch+squash, I think it would be OK to take this without waiting longer
for her. Up to you of course.

 - Emily
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help