[PATCH] Add explanatory comment for transport-helpers refs mapping.

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

 



transport-helpers can advertise the 'refspec' capability,
if not a default refspec *:* is assumed. This could be helpful
information for the reader.

Signed-off-by: Florian Achleitner <florian.achleitner.2.6.31@xxxxxxxxx>
---
 transport-helper.c |   10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/transport-helper.c b/transport-helper.c
index d6daad5..4a763a7 100644
--- a/transport-helper.c
+++ b/transport-helper.c
@@ -484,8 +484,18 @@ static int fetch_with_import(struct transport *transport,
 		if (posn->status & REF_STATUS_UPTODATE)
 			continue;
 		if (data->refspecs)
+			/*
+			 * If the remote-helper advertised the refpec capability, we
+			 * retrieve the local, private ref from it. The imported data is
+			 * expected there. (see Documentation/git-remote-helpers.*).
+			 */
 			private = apply_refspecs(data->refspecs, data->refspec_nr, posn-
>name);
 		else
+			/*
+			 * else, the default refspec *:* is implied. The remote-helper has
+			 * to import the remote heads directly to the local heads.
+			 * remote-helpers using 'import' should have the refspec capability.
+			 */
 			private = xstrdup(posn->name);
 		if (private) {
 			read_ref(private, posn->old_sha1);
-- 
1.7.9.5

--
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]