Add explanatory comment for transport-helpers refs mapping.
The patch below adds a comment to fetch_with_import() explaining the loop that saves the fetched commit names after 'git fast-import' has done its work. It avoids some confusion about which refs the fast-import stream is supposed to use to write its result. Signed-off-by: Florian Achleitner <florian.achleitner.2.6.31@gmail.com> Helped-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Florian Achleitner committed
Jul 30, 2012 at 16:31 UTC
dff9d65dc61af8a00a6eef153ebc59b76de9c412
1 file changed
+15
transport-helper.c
+15
@@ -444,6 +444,21 @@ static int fetch_with_import(struct transport *transport,
444
free(fastimport.argv);
445
fastimport.argv = NULL;
446
447
+ /*
448
+ * The fast-import stream of a remote helper that advertises
449
+ * the "refspec" capability writes to the refs named after the
450
+ * right hand side of the first refspec matching each ref we
451
+ * were fetching.
452
+ *
453
+ * (If no "refspec" capability was specified, for historical
454
+ * reasons we default to *:*.)
455
+ *
456
+ * Store the result in to_fetch[i].old_sha1. Callers such
457
+ * as "git fetch" can use the value to write feedback to the
458
+ * terminal, populate FETCH_HEAD, and determine what new value
459
+ * should be written to peer_ref if the update is a
460
+ * fast-forward or this is a forced update.
461
+ */
462
for (i = 0; i < nr_heads; i++) {
463
char *private;
464
posn = to_fetch[i];