diff options
author | SZEDER Gábor <szeder.dev@gmail.com> | 2017-06-15 02:43:56 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-06-21 15:44:37 -0700 |
commit | 145a7449789e259b81f9a8c61ba9e9ef7b062f9b (patch) | |
tree | 3e7b2ae39c24d37ca75a9ca0be315195db388fd9 /builtin/push.c | |
parent | eb0c621d1ec952048bc0b2222e2dd81f1fe58dbd (diff) | |
download | git-sg/remote-no-string-refspecs.tar.gz |
remote.c: eliminate remote->push_refspecsg/remote-no-string-refspecs
Do the same as in the previous patch, but for push refspecs, i.e. with
remote->push_refspec, remote->push and add_push_refspec().
Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com>
Diffstat (limited to 'builtin/push.c')
-rw-r--r-- | builtin/push.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/builtin/push.c b/builtin/push.c index 258648d5fd..9a721fe8a1 100644 --- a/builtin/push.c +++ b/builtin/push.c @@ -47,11 +47,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.rs) { struct refspec query; memset(&query, 0, sizeof(struct refspec)); query.src = matched->name; - if (!query_refspecs(remote->push, remote->push_refspec_nr, &query) && + if (!query_refspecs(remote->push.rs, remote->push.nr, &query) && query.dst) { struct strbuf buf = STRBUF_INIT; strbuf_addf(&buf, "%s%s:%s", @@ -401,9 +401,11 @@ 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.nr) { + ALLOC_ARRAY(refspec, remote->push.nr); + for (i = 0; i < remote->push.nr; i++) + refspec[i] = refspec_to_string(&remote->push.rs[i]); + refspec_nr = remote->push.nr; } else if (!(flags & TRANSPORT_PUSH_MIRROR)) setup_default_push_refspecs(remote); } |