]> git.ipfire.org Git - thirdparty/git.git/commit - refs.c
create_symref(): do not assume pathname from git_path() persists long enough
authorJunio C Hamano <junkio@cox.net>
Sat, 27 Jan 2007 01:49:00 +0000 (17:49 -0800)
committerJunio C Hamano <junkio@cox.net>
Sun, 28 Jan 2007 10:16:46 +0000 (02:16 -0800)
commit47fc52e2876ed3a54cd4b77e0b0c4875fa3317b8
tree48ed1a524b2a77a0608fc22147334717b3e18342
parent8b5157e40718a2ee1d645c342d93df4e66335479
create_symref(): do not assume pathname from git_path() persists long enough

Being lazy to rely on the cycling N buffers mkpath() and friends
return is nice in general, but it makes it too easy to introduce
new bugs that are "mysterious".

Introduction of read_ref() in create_symref() after calling
git_path() to get the git_HEAD value (i.e. the path to create a
new symref at) consumed more than the available buffers and
broke a later call to mkpath() that derives lockpath from it.

Signed-off-by: Junio C Hamano <junkio@cox.net>
refs.c