diff options
author | Florian Achleitner <florian.achleitner.2.6.31@gmail.com> | 2012-07-30 16:31:18 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2012-07-30 12:22:35 -0700 |
commit | dff9d65dc61af8a00a6eef153ebc59b76de9c412 (patch) | |
tree | 4bdbe322fba07f8a6385d30631a32ff13a753b91 | |
parent | 425b8a22aa14d624c807d5eed92c92f5cd32f376 (diff) | |
download | git-dff9d65dc61af8a00a6eef153ebc59b76de9c412.tar.gz |
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>
-rw-r--r-- | transport-helper.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/transport-helper.c b/transport-helper.c index 61c928f6cd..cfe0988490 100644 --- a/transport-helper.c +++ b/transport-helper.c @@ -444,6 +444,21 @@ static int fetch_with_import(struct transport *transport, free(fastimport.argv); fastimport.argv = NULL; + /* + * The fast-import stream of a remote helper that advertises + * the "refspec" capability writes to the refs named after the + * right hand side of the first refspec matching each ref we + * were fetching. + * + * (If no "refspec" capability was specified, for historical + * reasons we default to *:*.) + * + * Store the result in to_fetch[i].old_sha1. Callers such + * as "git fetch" can use the value to write feedback to the + * terminal, populate FETCH_HEAD, and determine what new value + * should be written to peer_ref if the update is a + * fast-forward or this is a forced update. + */ for (i = 0; i < nr_heads; i++) { char *private; posn = to_fetch[i]; |