Code

Merge branch 'jc/maint-bundle-too-quiet'
[git.git] / transport.c
index 98c577804f177b1c6f9df0e34e5fc3a656a81d27..e1940615e28ebc3b16f80b8f647f216031f64ee8 100644 (file)
@@ -10,6 +10,7 @@
 #include "refs.h"
 #include "branch.h"
 #include "url.h"
+#include "submodule.h"
 
 /* rsync support */
 
@@ -431,7 +432,8 @@ static int fetch_refs_from_bundle(struct transport *transport,
                               int nr_heads, struct ref **to_fetch)
 {
        struct bundle_transport_data *data = transport->data;
-       return unbundle(&data->header, data->fd);
+       return unbundle(&data->header, data->fd,
+                       transport->progress ? BUNDLE_VERBOSE : 0);
 }
 
 static int close_bundle(struct transport *transport)
@@ -482,18 +484,14 @@ static int set_git_option(struct git_transport_options *opts,
 static int connect_setup(struct transport *transport, int for_push, int verbose)
 {
        struct git_transport_data *data = transport->data;
-       struct strbuf sb = STRBUF_INIT;
 
        if (data->conn)
                return 0;
 
-       strbuf_addstr(&sb, for_push ? data->options.receivepack :
-                                data->options.uploadpack);
-       if (for_push && transport->verbose < 0)
-               strbuf_addstr(&sb, " --quiet");
-       data->conn = git_connect(data->fd, transport->url, sb.buf,
+       data->conn = git_connect(data->fd, transport->url,
+                                for_push ? data->options.receivepack :
+                                data->options.uploadpack,
                                 verbose ? CONNECT_VERBOSE : 0);
-       strbuf_release(&sb);
 
        return 0;
 }
@@ -1045,6 +1043,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;