summaryrefslogtreecommitdiff
path: root/write_or_die.c
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2015-08-10 05:37:12 -0400
committerJunio C Hamano <gitster@pobox.com>2015-08-10 15:37:13 -0700
commit5f8ef5b84889e7792e929a0fc773cb0060a0a611 (patch)
treed70f30f0ffbc18d404511477f267ec36aa384d9b /write_or_die.c
parentd6549f3655212bd2de52df0137ceb59180424061 (diff)
downloadgit-5f8ef5b84889e7792e929a0fc773cb0060a0a611.tar.gz
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 'write_or_die.c')
0 files changed, 0 insertions, 0 deletions