summaryrefslogtreecommitdiff
path: root/builtin/update-index.c
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2017-09-05 12:15:15 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-09-06 08:19:54 (GMT)
commitee4d8e455c0981269213eccfd788a9bb9adf77d9 (patch)
treef7cce828a422479c68db28849956c7f60186b35c /builtin/update-index.c
parent5e7f01c93e510c9c8d775665324abba15f05c3ff (diff)
downloadgit-ee4d8e455c0981269213eccfd788a9bb9adf77d9.zip
git-ee4d8e455c0981269213eccfd788a9bb9adf77d9.tar.gz
git-ee4d8e455c0981269213eccfd788a9bb9adf77d9.tar.bz2
ref_lock: stop leaking lock_files
Since the tempfile code recently relaxed the rule that tempfile structs (and thus locks) need to hang around forever, we no longer have to leak our lock_file structs. In fact, we don't even need to heap-allocate them anymore, since their lifetime can just match that of the surrounding ref_lock (and if we forget to delete a lock, the effect is the same as before: it will eventually go away at program exit). Note that there is a check in unlock_ref() to only rollback a lock file if it has been allocated. We don't need that check anymore; we zero the ref_lock (and thus the lock_file), so at worst we pass a NULL pointer to delete_tempfile(), which considers that a noop. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/update-index.c')
0 files changed, 0 insertions, 0 deletions