localrepo: Unlock symbolic refs when the update fails
We use a safe.LockingFileWriter
to get transactional semantics when
updating symbolic references. This mechanism will create a lock for the
file that is about to be updated, votes on the contents of the file and
then finally unlocks it if everything went alright. In case something
goes wrong though the caller must make sure to close the writer, or
otherwise we may leak the lockfile and thus also obstruct all subsequent
writes to that symbolic reference. We don't do this correctly though.
Fix this bug by always unlocking the locking file writer.
Fixes #4075 (closed)
Edited by Patrick Steinhardt