From: Felipe Contreras Date: Sat, 24 Nov 2012 03:25:15 GMT Subject: [PATCH v6 p2 4/9] transport-helper: fix push without refspec Message-ID: <1353727520-26039-5-git-send-email-felipe.contreras@gmail.com> In-Reply-To: <1353727520-26039-1-git-send-email-felipe.contreras@gmail.com> The refspec feature is not mandatory. Signed-off-by: Felipe Contreras --- t/t5801-remote-helpers.sh | 2 +- transport-helper.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/t/t5801-remote-helpers.sh b/t/t5801-remote-helpers.sh index 2e027c8..b268cd2 100755 --- a/t/t5801-remote-helpers.sh +++ b/t/t5801-remote-helpers.sh @@ -111,7 +111,7 @@ test_expect_success 'pulling without refspecs' ' compare_refs local2 HEAD server HEAD ' -test_expect_failure 'pushing without refspecs' ' +test_expect_success 'pushing without refspecs' ' test_when_finished "(cd local2 && git reset --hard origin)" && (cd local2 && echo content >>file && diff --git a/transport-helper.c b/transport-helper.c index 0c95101..899eb36 100644 --- a/transport-helper.c +++ b/transport-helper.c @@ -778,6 +778,9 @@ static int push_refs_with_export(struct transport *transport, if (ref->deletion) die("remote-helpers do not support ref deletion"); + if (ref->peer_ref) + string_list_append(&revlist_args, ref->peer_ref->name); + if (!data->refspecs) continue; private = apply_refspecs(data->refspecs, data->refspec_nr, ref->name); @@ -787,9 +790,6 @@ static int push_refs_with_export(struct transport *transport, } free(private); - if (ref->peer_ref) - string_list_append(&revlist_args, ref->peer_ref->name); - } if (get_exporter(transport, &exporter, &revlist_args)) -- 1.8.0