Re: [PATCH] make 'git clone' ask the remote only for objects it cares about
Nicolas Pitre <nico@fluxnic.net> wrote:
Show 7 quoted lines
> Current behavior of 'git clone' when not using --mirror is to fetch
> everything from the peer, and then filter out unwanted refs just before
> writing them out to the cloned repository. This may become highly
> inefficient if the peer has an unusual ref namespace, or if it simply
> has "remotes" refs of its own, and those locally unwanted refs are
> connecting to a large set of objects which becomes unreferenced as soon
> as they are fetched.
> +static void write_remote_refs(const struct ref *local_refs, const char *reflog)
Here reflog is now unused. I'm going to squash this in.
diff --git a/builtin-clone.c b/builtin-clone.c
index edf7c7f..4992c25 100644
--- a/builtin-clone.c
+++ b/builtin-clone.c
@@ -342,7 +342,7 @@ static struct ref *wanted_peer_refs(const struct ref *refs,
return local_refs;
}
-static void write_remote_refs(const struct ref *local_refs, const char *reflog)
+static void write_remote_refs(const struct ref *local_refs)
{
const struct ref *r;
@@ -534,7 +534,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
if (refs) {
clear_extra_refs();
- write_remote_refs(mapped_refs, reflog_msg.buf);
+ write_remote_refs(mapped_refs);
remote_head = find_ref_by_name(refs, "HEAD");
remote_head_points_at =
--
Shawn.