diff options
author | Jeff King <peff@peff.net> | 2015-08-10 05:37:12 -0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2015-08-10 15:37:13 -0700 |
commit | 5f8ef5b84889e7792e929a0fc773cb0060a0a611 (patch) | |
tree | d70f30f0ffbc18d404511477f267ec36aa384d9b /t/t5515/refs.br-branches-one-merge | |
parent | refs.c: avoid repeated git_path calls in rename_tmp_log (diff) | |
download | tgif-5f8ef5b84889e7792e929a0fc773cb0060a0a611.tar.xz |
refs.c: avoid git_path assignment in lock_ref_sha1_basic
Assigning the result of git_path is a bad pattern, because
it's not immediately obvious how long you expect the content
to stay valid (and it may be overwritten by subsequent
calls). Let's use a function-local strbuf here instead,
which we know is safe (we just have to remember to free it
in all code paths).
As a bonus, we get rid of a confusing variable-reuse
("ref_file" is used for two distinct purposes).
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t5515/refs.br-branches-one-merge')
0 files changed, 0 insertions, 0 deletions