refs.c: avoid repeated git_path calls in rename_tmp_log
commitd6549f3655212bd2de52df0137ceb59180424061
authorJeff King <peff@peff.net>
Mon, 10 Aug 2015 09:36:53 +0000 (10 05:36 -0400)
committerJunio C Hamano <gitster@pobox.com>
Mon, 10 Aug 2015 22:37:13 +0000 (10 15:37 -0700)
tree89ea714cfc8f344ad008a4877f57e3b97ccd8890
parent54b418f6985568bcb71c354ada204efe103b870e
refs.c: avoid repeated git_path calls in rename_tmp_log

Because it's not safe to store the static-buffer results of
git_path for a long time, we end up formatting the same
filename over and over. We can fix this by using a
function-local strbuf to store the formatted pathname and
avoid repeating ourselves.

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