diff options
author | Carlos Martín Nieto <cmn@dwim.me> | 2013-04-20 06:43:28 +0400 |
---|---|---|
committer | Carlos Martín Nieto <cmn@dwim.me> | 2013-04-20 19:54:13 +0400 |
commit | 4330ab26b53c0e1bf8cbb5e65704f65e3d116eba (patch) | |
tree | 14bf8d854854298bfe43b3a02c8c26f59377c988 /src/push.c | |
parent | e5a27f039ee3ae1291fd5084707c3f9c168f10ba (diff) |
remote: handle multiple refspecs
A remote can have a multitude of refspecs. Up to now our git_remote's
have supported a single one for each fetch and push out of simplicity
to get something working.
Let the remotes and internal code know about multiple remotes and get
the tests passing with them.
Instead of setting a refspec, the external users can clear all and add
refspecs. This should be enough for most uses, though we're still
missing a querying function.
Diffstat (limited to 'src/push.c')
-rw-r--r-- | src/push.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/push.c b/src/push.c index cec4c64af..b6be1a4e1 100644 --- a/src/push.c +++ b/src/push.c @@ -177,9 +177,9 @@ int git_push_add_refspec(git_push *push, const char *refspec) int git_push_update_tips(git_push *push) { - git_refspec *fetch_spec = &push->remote->fetch; git_buf remote_ref_name = GIT_BUF_INIT; size_t i, j; + git_refspec *fetch_spec; push_spec *push_spec; git_reference *remote_ref; push_status *status; @@ -191,7 +191,8 @@ int git_push_update_tips(git_push *push) continue; /* Find the corresponding remote ref */ - if (!git_refspec_src_matches(fetch_spec, status->ref)) + fetch_spec = git_remote__matching_refspec(push->remote, status->ref); + if (!fetch_spec) continue; if ((error = git_refspec_transform_r(&remote_ref_name, fetch_spec, status->ref)) < 0) |