Code

resolve_ref(): turn buffer into a proper string as soon as possible
authorMichael Haggerty <mhagger@alum.mit.edu>
Thu, 15 Sep 2011 21:10:34 +0000 (23:10 +0200)
committerJunio C Hamano <gitster@pobox.com>
Wed, 5 Oct 2011 20:45:30 +0000 (13:45 -0700)
commit287750507d3859ff65a7b0baac5ba1fdf30e9604
tree3b07eb9245d19fbef7db86837a2062d431610d22
parent1f58a0383857e5328e3e4d248d6c4a3485098679
resolve_ref(): turn buffer into a proper string as soon as possible

Immediately strip off trailing spaces and null-terminate the string
holding the contents of the reference file; this allows the use of
string functions and avoids the need to keep separate track of the
string's length.  (get_sha1_hex() fails automatically if the string is
too short.)

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
refs.c