Don't bother passing ref log details to walker in builtin-fetch
authorShawn O. Pearce <spearce@spearce.org>
Sat, 15 Sep 2007 07:23:04 +0000 (03:23 -0400)
committerJunio C Hamano <gitster@pobox.com>
Wed, 19 Sep 2007 10:22:31 +0000 (03:22 -0700)
When using the walker API within builtin-fetch we don't allow
it to update refs locally; instead that action is reserved for
builtin-fetch's own main loop once the objects have actually
been downloaded.

Passing NULL here will bypass the unnecessary malloc/free of a
string buffer within the walker API.  That buffer is never used
because the prior argument (the refs to update) is also NULL.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
transport.c

index 0338ed45b9bdc6f8c3300674a4c12e74db4a9b2c..002119061edfbce3cb6a6bdc34cbd0759b87cf25 100644 (file)
@@ -26,7 +26,7 @@ static int fetch_objs_via_walker(struct transport *transport,
        for (i = 0; i < nr_objs; i++)
                objs[i] = xstrdup(sha1_to_hex(to_fetch[i]->old_sha1));
 
-       if (walker_fetch(walker, nr_objs, objs, NULL, dest))
+       if (walker_fetch(walker, nr_objs, objs, NULL, NULL))
                die("Fetch failed.");
 
        for (i = 0; i < nr_objs; i++)