write_remote_refs(): create packed (rather than extra) refs
write_remote_refs() creates new packed refs from references obtained from the remote repository, which is "out of thin air" as far as the local repository is concerned. Previously it did this by creating "extra" refs, then calling pack_refs() to bake them into the packed-refs file. Instead, create packed refs (in the packed reference cache) directly, then call pack_refs(). Aside from being more logical, this is another step towards removing extra refs entirely. Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Michael Haggerty committed
Jan 17, 2012 at 06:50 UTC
39ef7fae9a398ad4523a211bc87aff599c3d3869
1 file changed
+1
-2
builtin/clone.c
+1
-2
@@ -441,11 +441,10 @@ static void write_remote_refs(const struct ref *local_refs)
441
for (r = local_refs; r; r = r->next) {
442
if (!r->peer_ref)
443
continue;
444
- add_extra_ref(r->peer_ref->name, r->old_sha1, 0);
444
+ add_packed_ref(r->peer_ref->name, r->old_sha1);
445
}
446
447
pack_refs(PACK_REFS_ALL);
448
- clear_extra_refs();
448
}
449
450
static int write_one_config(const char *key, const char *value, void *data)