fetch: convert prune_refs to take a struct refspec
[gitweb.git] / builtin / push.c
index ac3705370e12fda53da086f33c6b47925a48873c..509dc667724ecdfbc1f0ca19d14f1fee34fba757 100644 (file)
@@ -4,6 +4,7 @@
 #include "cache.h"
 #include "config.h"
 #include "refs.h"
+#include "refspec.h"
 #include "run-command.h"
 #include "builtin.h"
 #include "remote.h"
@@ -78,11 +79,11 @@ static const char *map_refspec(const char *ref,
        if (count_refspec_match(ref, local_refs, &matched) != 1)
                return ref;
 
-       if (remote->push) {
-               struct refspec query;
-               memset(&query, 0, sizeof(struct refspec));
+       if (remote->push.nr) {
+               struct refspec_item query;
+               memset(&query, 0, sizeof(struct refspec_item));
                query.src = matched->name;
-               if (!query_refspecs(remote->push, remote->push_refspec_nr, &query) &&
+               if (!query_refspecs(remote->push.items, remote->push.nr, &query) &&
                    query.dst) {
                        struct strbuf buf = STRBUF_INIT;
                        strbuf_addf(&buf, "%s%s:%s",
@@ -435,9 +436,9 @@ static int do_push(const char *repo, int flags,
        }
 
        if (!refspec && !(flags & TRANSPORT_PUSH_ALL)) {
-               if (remote->push_refspec_nr) {
-                       refspec = remote->push_refspec;
-                       refspec_nr = remote->push_refspec_nr;
+               if (remote->push.raw_nr) {
+                       refspec = remote->push.raw;
+                       refspec_nr = remote->push.raw_nr;
                } else if (!(flags & TRANSPORT_PUSH_MIRROR))
                        setup_default_push_refspecs(remote);
        }