diff options
author | Carlos Martín Nieto <cmn@dwim.me> | 2014-11-07 15:00:11 +0100 |
---|---|---|
committer | Carlos Martín Nieto <cmn@dwim.me> | 2014-11-09 16:07:43 +0100 |
commit | aad638f3a1e4d98296c2ec9c4ed08f217a652c5c (patch) | |
tree | 4276b661b94c788f5aca4c5757846af758bf89d3 /src/transports/local.c | |
parent | b4e5432ff032c7d05c82ad2871e27f990493d6b7 (diff) | |
download | libgit2-aad638f3a1e4d98296c2ec9c4ed08f217a652c5c.tar.gz |
push: use the common refspec parsercmn/push-refspec-refactor
There is one well-known and well-tested parser which we should use,
instead of implementing parsing a second time.
The common parser is also augmented to copy the LHS into the RHS if the
latter is empty.
The expressions test had to change a bit, as we now catch a bad RHS of a
refspec locally.
Diffstat (limited to 'src/transports/local.c')
-rw-r--r-- | src/transports/local.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/transports/local.c b/src/transports/local.c index f859f0b70..05302a13f 100644 --- a/src/transports/local.c +++ b/src/transports/local.c @@ -405,7 +405,7 @@ static int local_push( git_vector_foreach(&push->specs, j, spec) { push_status *status; const git_error *last; - char *ref = spec->rref ? spec->rref : spec->lref; + char *ref = spec->refspec.dst; status = git__calloc(sizeof(push_status), 1); if (!status) @@ -417,7 +417,7 @@ static int local_push( goto on_error; } - error = local_push_update_remote_ref(remote_repo, spec->lref, spec->rref, + error = local_push_update_remote_ref(remote_repo, spec->refspec.src, spec->refspec.dst, &spec->loid, &spec->roid); switch (error) { |