]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Merge branch 'jc/maint-bundle-too-quiet' into maint
authorJunio C Hamano <gitster@pobox.com>
Sun, 16 Oct 2011 03:46:39 +0000 (20:46 -0700)
committerJunio C Hamano <gitster@pobox.com>
Sun, 16 Oct 2011 03:46:39 +0000 (20:46 -0700)
* jc/maint-bundle-too-quiet:
  Teach progress eye-candy to fetch_refs_from_bundle()

1  2 
transport.c

diff --combined transport.c
index fa279d531fe1b99841424080487e685fbe04e5bb,ca01500668f5096cd31d464a6f2995f60be0e3d6..e1940615e28ebc3b16f80b8f647f216031f64ee8
@@@ -10,7 -10,6 +10,7 @@@
  #include "refs.h"
  #include "branch.h"
  #include "url.h"
 +#include "submodule.h"
  
  /* rsync support */
  
@@@ -157,7 -156,7 +157,7 @@@ static void set_upstreams(struct transp
                        continue;
                if (!ref->peer_ref)
                        continue;
 -              if (!ref->new_sha1 || is_null_sha1(ref->new_sha1))
 +              if (is_null_sha1(ref->new_sha1))
                        continue;
  
                /* Follow symbolic refs (mainly for HEAD). */
@@@ -432,7 -431,8 +432,8 @@@ static int fetch_refs_from_bundle(struc
                               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)
@@@ -1042,14 -1042,6 +1043,14 @@@ int transport_push(struct transport *tr
                        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;
@@@ -1199,20 -1191,14 +1200,20 @@@ literal_copy
        return xstrdup(url);
  }
  
 -int refs_from_alternate_cb(struct alternate_object_database *e, void *cb)
 +struct alternate_refs_data {
 +      alternate_ref_fn *fn;
 +      void *data;
 +};
 +
 +static int refs_from_alternate_cb(struct alternate_object_database *e,
 +                                void *data)
  {
        char *other;
        size_t len;
        struct remote *remote;
        struct transport *transport;
        const struct ref *extra;
 -      alternate_ref_fn *ref_fn = cb;
 +      struct alternate_refs_data *cb = data;
  
        e->name[-1] = '\0';
        other = xstrdup(real_path(e->base));
        for (extra = transport_get_remote_refs(transport);
             extra;
             extra = extra->next)
 -              ref_fn(extra, NULL);
 +              cb->fn(extra, cb->data);
        transport_disconnect(transport);
        free(other);
        return 0;
  }
 +
 +void for_each_alternate_ref(alternate_ref_fn fn, void *data)
 +{
 +      struct alternate_refs_data cb;
 +      cb.fn = fn;
 +      cb.data = data;
 +      foreach_alt_odb(refs_from_alternate_cb, &cb);
 +}