lockfile: change lock_file::filename into a strbuf
commitcf6950d3bfe1447ac04867b1f5654a2fc9c5db96
authorMichael Haggerty <mhagger@alum.mit.edu>
Wed, 1 Oct 2014 10:28:32 +0000 (1 12:28 +0200)
committerJunio C Hamano <gitster@pobox.com>
Wed, 1 Oct 2014 20:50:01 +0000 (1 13:50 -0700)
tree2c99e3011a6e6f27286091a7066fe8c91683bcd1
parent3e88e8fc085bbfad142d51a07ef918b9b5ca1d72
lockfile: change lock_file::filename into a strbuf

For now, we still make sure to allocate at least PATH_MAX characters
for the strbuf because resolve_symlink() doesn't know how to expand
the space for its return value.  (That will be fixed in a moment.)

Another alternative would be to just use a strbuf as scratch space in
lock_file() but then store a pointer to the naked string in struct
lock_file.  But lock_file objects are often reused.  By reusing the
same strbuf, we can avoid having to reallocate the string most times
when a lock_file object is reused.

Helped-by: Torsten Bögershausen <tboegi@web.de>
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/commit.c
builtin/reflog.c
cache.h
config.c
lockfile.c
read-cache.c
refs.c
shallow.c