diff options
author | Junio C Hamano <gitster@pobox.com> | 2016-12-16 15:27:48 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2016-12-16 15:27:48 -0800 |
commit | 12cf1135df64ae2a94e6146f96fdb963d2ee152e (patch) | |
tree | 740e28ea6e2d953c5cdc5b709cfeafad3f0c3543 /transport.c | |
parent | af952dac7a6997e587ded97e4051a927e5384423 (diff) | |
parent | 0301c821c5cd124733accfbff0ddbf7f0b0ee9fb (diff) | |
download | git-12cf1135df64ae2a94e6146f96fdb963d2ee152e.tar.gz |
Merge branch 'bw/push-dry-run'
"git push --dry-run --recurse-submodule=on-demand" wasn't
"--dry-run" in the submodules.
* bw/push-dry-run:
push: fix --dry-run to not push submodules
push: --dry-run updates submodules when --recurse-submodules=on-demand
Diffstat (limited to 'transport.c')
-rw-r--r-- | transport.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/transport.c b/transport.c index f482869057..04e5d6623e 100644 --- a/transport.c +++ b/transport.c @@ -955,15 +955,18 @@ int transport_push(struct transport *transport, if (!is_null_oid(&ref->new_oid)) sha1_array_append(&commits, ref->new_oid.hash); - if (!push_unpushed_submodules(&commits, transport->remote->name)) { + if (!push_unpushed_submodules(&commits, + transport->remote->name, + pretend)) { sha1_array_clear(&commits); die("Failed to push all needed submodules!"); } sha1_array_clear(&commits); } - if ((flags & (TRANSPORT_RECURSE_SUBMODULES_ON_DEMAND | - TRANSPORT_RECURSE_SUBMODULES_CHECK)) && !is_bare_repository()) { + if (((flags & TRANSPORT_RECURSE_SUBMODULES_CHECK) || + ((flags & TRANSPORT_RECURSE_SUBMODULES_ON_DEMAND) && + !pretend)) && !is_bare_repository()) { struct ref *ref = remote_refs; struct string_list needs_pushing = STRING_LIST_INIT_DUP; struct sha1_array commits = SHA1_ARRAY_INIT; |