aboutsummaryrefslogtreecommitdiffstats
path: root/submodule.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2022-11-23 11:22:25 +0900
committerJunio C Hamano <gitster@pobox.com>2022-11-23 11:22:25 +0900
commit173fc54b005c92dc0da0fe5e71034128eddbacc8 (patch)
tree869d4529c5bc12b559393391d3dcc45b9260b980 /submodule.c
parent8d7b35b43df56bacd005492402c6a583284c0fec (diff)
parente62f779ae67ce3babe9e4ee934469993a5e6df49 (diff)
downloadgit-173fc54b005c92dc0da0fe5e71034128eddbacc8.tar.gz
Merge branch 'jt/submodule-on-demand'
Push all submodules recursively with '--recurse-submodules=on-demand'. * jt/submodule-on-demand: Doc: document push.recurseSubmodules=only
Diffstat (limited to 'submodule.c')
-rw-r--r--submodule.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/submodule.c b/submodule.c
index 8fa2ad457b..8ac2fca855 100644
--- a/submodule.c
+++ b/submodule.c
@@ -1130,6 +1130,12 @@ static int push_submodule(const char *path,
if (for_each_remote_ref_submodule(path, has_remote, NULL) > 0) {
struct child_process cp = CHILD_PROCESS_INIT;
strvec_push(&cp.args, "push");
+ /*
+ * When recursing into a submodule, treat any "only" configurations as "on-
+ * demand", since "only" would not work (we need all submodules to be pushed
+ * in order to be able to push the superproject).
+ */
+ strvec_push(&cp.args, "--recurse-submodules=only-is-on-demand");
if (dry_run)
strvec_push(&cp.args, "--dry-run");