git_snpath(): retire and replace with strbuf_git_path()
commit4c77df36c9fafa6a5e95915424bb570d4f01d54b
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>
Sun, 13 Jul 2014 04:50:40 +0000 (13 11:50 +0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 14 Jul 2014 01:26:53 +0000 (13 18:26 -0700)
tree02b8e9e9f9a44877619d09ac35e644d43d7ff48f
parent63062be20cdc880268ef2f2fe39904e4a4cbf7b1
git_snpath(): retire and replace with strbuf_git_path()

In the previous patch, git_snpath() is modified to allocate a new
strbuf buffer because vsnpath() needs that. But that makes it
awkward because git_snpath() receives a pre-allocated buffer from
outside and has to copy data back. Rename it to strbuf_git_path()
and make it receive strbuf directly.

Using git_path() in update_refs_for_switch() which used to call
git_snpath() is safe because that function and all of its callers do
not keep any pointer to the round-robin buffer pool allocated by
get_pathname().

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/checkout.c
cache.h
path.c
refs.c
refs.h