summaryrefslogtreecommitdiff
path: root/transport.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2016-12-16 23:27:48 (GMT)
committerJunio C Hamano <gitster@pobox.com>2016-12-16 23:27:48 (GMT)
commit12cf1135df64ae2a94e6146f96fdb963d2ee152e (patch)
tree740e28ea6e2d953c5cdc5b709cfeafad3f0c3543 /transport.c
parentaf952dac7a6997e587ded97e4051a927e5384423 (diff)
parent0301c821c5cd124733accfbff0ddbf7f0b0ee9fb (diff)
downloadgit-12cf1135df64ae2a94e6146f96fdb963d2ee152e.zip
git-12cf1135df64ae2a94e6146f96fdb963d2ee152e.tar.gz
git-12cf1135df64ae2a94e6146f96fdb963d2ee152e.tar.bz2
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.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/transport.c b/transport.c
index f482869..04e5d66 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;