diff options
author | Junio C Hamano <gitster@pobox.com> | 2017-01-17 14:49:27 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-01-17 14:49:27 -0800 |
commit | 3075e40c75560d93b569d1bba715008ca734ad83 (patch) | |
tree | d23ecc348dde5dabd0ad8929fc84aab5e9fcd881 /transport.c | |
parent | 9da9965ba6672dc0016a5ac694271bbdd4589e15 (diff) | |
parent | 0301c821c5cd124733accfbff0ddbf7f0b0ee9fb (diff) | |
download | git-3075e40c75560d93b569d1bba715008ca734ad83.tar.gz |
Merge branch 'bw/push-dry-run' into maint
"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; |