Merge pull request #204 from pre-commit/dont_rename_across_devices

Don't rename across devices.  Resolves #203
This commit is contained in:
Anthony Sottile 2015-02-27 10:21:28 -08:00
commit 5e80b6a4ab

View file

@ -62,7 +62,7 @@ class Store(object):
def _write_sqlite_db(self):
# To avoid a race where someone ^Cs between db creation and execution
# of the CREATE TABLE statement
fd, tmpfile = tempfile.mkstemp()
fd, tmpfile = tempfile.mkstemp(dir=self.directory)
# We'll be managing this file ourselves
os.close(fd)
# sqlite doesn't close its fd with its contextmanager >.<