git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 2/2] builtin/push: move flags do_push

From
Stefan Beller <sbeller@google.com>
Date
Oct 4, 2016, 19:29 UTC
Message-ID
<20161004192910.30649-2-sbeller@google.com>
In-Reply-To
<20161004192910.30649-1-sbeller@google.com>

In do_push we set the flags for other options, so let's make the code more consistent and also apply the flags for recursing into submodules there.

Signed-off-by: Stefan Beller <sbeller@google.com>
---

No functional change intended, just a cleanup while we're at it. Feel free to drop if it's too much churn.

 builtin/push.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/builtin/push.c b/builtin/push.c
index 06fd3bd..6690301 100644
--- a/builtin/push.c
+++ b/builtin/push.c
@@ -388,6 +388,11 @@ static int do_push(const char *repo, int flags,
 		    "    git push <name>\n"));
 	}
 
+	if (recurse_submodules == RECURSE_SUBMODULES_CHECK)
+		flags |= TRANSPORT_RECURSE_SUBMODULES_CHECK;
+	else if (recurse_submodules == RECURSE_SUBMODULES_ON_DEMAND)
+		flags |= TRANSPORT_RECURSE_SUBMODULES_ON_DEMAND;
+
 	if (remote->mirror)
 		flags |= (TRANSPORT_PUSH_MIRROR|TRANSPORT_PUSH_FORCE);
 
@@ -576,11 +581,6 @@ int cmd_push(int argc, const char **argv, const char *prefix)
 	if (deleterefs && argc < 2)
 		die(_("--delete doesn't make sense without any refs"));
 
-	if (recurse_submodules == RECURSE_SUBMODULES_CHECK)
-		flags |= TRANSPORT_RECURSE_SUBMODULES_CHECK;
-	else if (recurse_submodules == RECURSE_SUBMODULES_ON_DEMAND)
-		flags |= TRANSPORT_RECURSE_SUBMODULES_ON_DEMAND;
-
 	if (tags)
 		add_refspec("refs/tags/*");
 
-- 
2.10.0.129.g35f6318
Previous: Stefan BellerNext: Jeff King
Message 19 of 31 in “Slow pushes on 'pu' - even when up-to-date..”
  1. Linus TorvaldsOct 3, 2016
  2. Stefan BellerOct 3, 2016
  3. Stefan BellerOct 3, 2016
  4. Junio C HamanoOct 3, 2016
  5. Heiko VoigtOct 4, 2016
  6. Jeff KingOct 4, 2016
  7. Heiko VoigtOct 4, 2016
  8. Jeff KingOct 4, 2016
  9. Junio C HamanoOct 4, 2016
  10. Jeff KingOct 4, 2016
  11. push: change submodule default to checkStefan Beller, Oct 4, 2016
  12. Jeff KingOct 4, 2016
  13. Stefan BellerOct 4, 2016
  14. Jeff KingOct 4, 2016
  15. Junio C HamanoOct 4, 2016
  16. Stefan BellerOct 4, 2016
  17. Jeff KingOct 4, 2016
  18. 1/2 push: change submodule default to check when submodules existStefan Beller, Oct 4, 2016
  19. 2/2 builtin/push: move flags do_pushStefan Beller, Oct 4, 2016
  20. Jeff KingOct 4, 2016
  21. Stefan BellerOct 4, 2016
  22. 1/2 push: change submodule default to check when submodules existStefan Beller, Oct 4, 2016
  23. Heiko VoigtOct 5, 2016
  24. Heiko VoigtOct 6, 2016
  25. Stefan BellerOct 6, 2016
  26. Heiko VoigtOct 7, 2016
  27. Jeff KingOct 5, 2016
  28. Stefan BellerOct 5, 2016
  29. Junio C HamanoOct 4, 2016
  30. Junio C HamanoOct 4, 2016
  31. Stefan BellerOct 4, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.