X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=transport.c;h=fa279d531fe1b99841424080487e685fbe04e5bb;hb=9224b73be03845a99f8171c57dc282f806b70f4c;hp=c9c8056f9de69bd378cd271d70363b5560f13e07;hpb=a35d78c0f483a65ea96c4f0c9a825bf28a386273;p=git.git diff --git a/transport.c b/transport.c index c9c8056f9..fa279d531 100644 --- a/transport.c +++ b/transport.c @@ -10,6 +10,7 @@ #include "refs.h" #include "branch.h" #include "url.h" +#include "submodule.h" /* rsync support */ @@ -1041,6 +1042,14 @@ int transport_push(struct transport *transport, flags & TRANSPORT_PUSH_MIRROR, flags & TRANSPORT_PUSH_FORCE); + if ((flags & TRANSPORT_RECURSE_SUBMODULES_CHECK) && !is_bare_repository()) { + struct ref *ref = remote_refs; + for (; ref; ref = ref->next) + if (!is_null_sha1(ref->new_sha1) && + check_submodule_needs_pushing(ref->new_sha1,transport->remote->name)) + die("There are unpushed submodules, aborting."); + } + push_ret = transport->push_refs(transport, remote_refs, flags); err = push_had_errors(remote_refs); ret = push_ret | err;