remote: convert push refspecs to struct refspec
[git/git.git] / builtin / push.c
index 00d81fb..509dc66 100644 (file)
@@ -79,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) {
+       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",
@@ -436,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);
        }