diff options
author | Jeff King <peff@peff.net> | 2017-09-05 08:14:07 -0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-09-06 17:19:52 +0900 |
commit | c82c75b9518750a94e38c84fc89741a51b815014 (patch) | |
tree | a63ff13b872b8614172ab8a77151039cf61b83aa /README.md | |
parent | The sixth batch post 2.14 (diff) | |
download | tgif-c82c75b9518750a94e38c84fc89741a51b815014.tar.xz |
write_index_as_tree: cleanup tempfile on error
If we failed to write our new index file, we rollback our
lockfile to remove the temporary index. But if we fail
before we even get to the write step (because reading the
old index failed), we leave the lockfile in place, which
makes no sense.
In practice this hasn't been a big deal because failing at
write_index_as_tree() typically results in the whole program
exiting (and thus the tempfile handler kicking in and
cleaning up the files). But this function should
consistently take responsibility for the resources it
allocates.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'README.md')
0 files changed, 0 insertions, 0 deletions