From 8faf96c1ad5de90c4f9ca0dd41b1ec1c88ff590e Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Fri, 27 Feb 2015 10:11:26 -0800 Subject: [PATCH] Don't rename across devices. Resolves #203 --- pre_commit/store.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pre_commit/store.py b/pre_commit/store.py index 9d486400..a9197c43 100644 --- a/pre_commit/store.py +++ b/pre_commit/store.py @@ -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 >.<