[PATCH v6 p2 4/9] transport-helper: fix push without refspec

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The refspec feature is not mandatory.

Signed-off-by: Felipe Contreras <felipe.contreras@xxxxxxxxx>
---
 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

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]