author | Michael Haggerty <mhagger@alum.mit.edu> | |
Fri, 6 Jan 2012 14:12:33 +0000 (15:12 +0100) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Fri, 6 Jan 2012 19:26:41 +0000 (11:26 -0800) | ||
commit | 85f251045019296a9143fd6527a48461e7b7c0e7 | |
tree | ed65ba36dc2f3669aa2017ea9badefcd1dd10a9f | tree | snapshot |
parent | bc98201d84eb3eb283aa4ebb9de9f7a3b32b97af | commit | diff |
write_head_info(): handle "extra refs" locally
The old code basically did:
generate array of SHA1s for alternate refs
for each unique SHA1 in array:
add_extra_ref(".have", sha1)
for each ref (including real refs and extra refs):
show_ref(refname, sha1)
But there is no need to stuff the alternate refs in extra_refs; we can
call show_ref() directly when iterating over the array, then handle
real refs separately. So change the code to:
generate array of SHA1s for alternate refs
for each unique SHA1 in array:
show_ref(".have", sha1)
for each ref (this now only includes real refs):
show_ref(refname, sha1)
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
The old code basically did:
generate array of SHA1s for alternate refs
for each unique SHA1 in array:
add_extra_ref(".have", sha1)
for each ref (including real refs and extra refs):
show_ref(refname, sha1)
But there is no need to stuff the alternate refs in extra_refs; we can
call show_ref() directly when iterating over the array, then handle
real refs separately. So change the code to:
generate array of SHA1s for alternate refs
for each unique SHA1 in array:
show_ref(".have", sha1)
for each ref (this now only includes real refs):
show_ref(refname, sha1)
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/receive-pack.c | diff | blob | history |