refs.c: remove_empty_directories can take a strbuf
commit470e28d4e16dd994cd985914377fa8ccb5f86227
authorJeff King <peff@peff.net>
Mon, 10 Aug 2015 09:37:27 +0000 (10 05:37 -0400)
committerJunio C Hamano <gitster@pobox.com>
Mon, 10 Aug 2015 22:37:13 +0000 (10 15:37 -0700)
treed931740e44eff33ae5c83028c869a7217363e663
parent5f8ef5b84889e7792e929a0fc773cb0060a0a611
refs.c: remove_empty_directories can take a strbuf

The first thing we do in this function is copy the input
into a strbuf. Of the 4 callers, 3 of them already have a
strbuf we could use. Let's just take the strbuf, and convert
the remaining caller to use a strbuf, rather than a raw
git_path. This is safer, anyway, as remove_dir_recursively
is a non-trivial function that might use the pathname
buffers itself (this is _probably_ OK, as the likely culprit
would be calling resolve_gitlink_ref, but we do not pass the
proper flags to ask it to avoid blowing away gitlinks).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
refs.c