We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Crash on `local`-only `golang` repositories
While investigating: https://github.com/pre-commit/pre-commit-hooks/issues/255

Using this configuration:

```yaml
repos:
-   repo: local
    hooks:
    -   id: talisman
        name: talisman
        entry: talisman -githook pre-commit
        pass_filenames: false
        types: [text]
        language: golang
        additional_dependencies: [github.com/thoughtworks/talisman]
```

```
$ pre-commit run --all-files
[INFO] Initializing environment for local:github.com/thoughtworks/talisman.
[INFO] Installing environment for local.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
An unexpected error has occurred: CalledProcessError: Command: ('/usr/bin/git', 'config', 'remote.origin.url')
Return code: 1
Expected return code: 0
Output: (none)
Errors: (none)

Check the log at /home/asottile/.cache/pre-commit/pre-commit.log
```

```
An unexpected error has occurred: CalledProcessError: Command: ('/usr/bin/git', 'config', 'remote.origin.url')
Return code: 1
Expected return code: 0
Output: (none)
Errors: (none)

Traceback (most recent call last):
  File "/tmp/wat/venv/local/lib/python2.7/site-packages/pre_commit/error_handler.py", line 47, in error_handler
    yield
  File "/tmp/wat/venv/local/lib/python2.7/site-packages/pre_commit/main.py", line 259, in main
    return run(runner, args)
  File "/tmp/wat/venv/local/lib/python2.7/site-packages/pre_commit/commands/run.py", line 256, in run
    repo.require_installed()
  File "/tmp/wat/venv/local/lib/python2.7/site-packages/pre_commit/repository.py", line 202, in require_installed
    _install_all(self._venvs, self.repo_config['repo'], self.store)
  File "/tmp/wat/venv/local/lib/python2.7/site-packages/pre_commit/repository.py", line 102, in _install_all
    language.install_environment(cmd_runner, version, deps)
  File "/tmp/wat/venv/local/lib/python2.7/site-packages/pre_commit/languages/golang.py", line 60, in install_environment
    remote = git.get_remote_url(repo_cmd_runner.path())
  File "/tmp/wat/venv/local/lib/python2.7/site-packages/pre_commit/git.py", line 41, in get_remote_url
    ret = cmd_output('git', 'config', 'remote.origin.url', cwd=git_root)[1]
  File "/tmp/wat/venv/local/lib/python2.7/site-packages/pre_commit/util.py", line 188, in cmd_output
    returncode, cmd, retcode, output=(stdout, stderr),
CalledProcessError: Command: ('/usr/bin/git', 'config', 'remote.origin.url')
Return code: 1
Expected return code: 0
Output: (none)
Errors: (none)
```

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `pre_commit/store.py`
Content:
```
1 from __future__ import unicode_literals
2 
3 import contextlib
4 import io
5 import logging
6 import os.path
7 import sqlite3
8 import tempfile
9 
10 from cached_property import cached_property
11 
12 import pre_commit.constants as C
13 from pre_commit import file_lock
14 from pre_commit.util import clean_path_on_failure
15 from pre_commit.util import cmd_output
16 from pre_commit.util import copy_tree_to_path
17 from pre_commit.util import cwd
18 from pre_commit.util import no_git_env
19 from pre_commit.util import resource_filename
20 
21 
22 logger = logging.getLogger('pre_commit')
23 
24 
25 def _get_default_directory():
26     """Returns the default directory for the Store.  This is intentionally
27     underscored to indicate that `Store.get_default_directory` is the intended
28     way to get this information.  This is also done so
29     `Store.get_default_directory` can be mocked in tests and
30     `_get_default_directory` can be tested.
31     """
32     return os.environ.get('PRE_COMMIT_HOME') or os.path.join(
33         os.environ.get('XDG_CACHE_HOME') or os.path.expanduser('~/.cache'),
34         'pre-commit',
35     )
36 
37 
38 class Store(object):
39     get_default_directory = staticmethod(_get_default_directory)
40     __created = False
41 
42     def __init__(self, directory=None):
43         if directory is None:
44             directory = self.get_default_directory()
45 
46         self.directory = directory
47 
48     @contextlib.contextmanager
49     def exclusive_lock(self):
50         def blocked_cb():  # pragma: no cover (tests are single-process)
51             logger.info('Locking pre-commit directory')
52 
53         with file_lock.lock(os.path.join(self.directory, '.lock'), blocked_cb):
54             yield
55 
56     def _write_readme(self):
57         with io.open(os.path.join(self.directory, 'README'), 'w') as readme:
58             readme.write(
59                 'This directory is maintained by the pre-commit project.\n'
60                 'Learn more: https://github.com/pre-commit/pre-commit\n',
61             )
62 
63     def _write_sqlite_db(self):
64         # To avoid a race where someone ^Cs between db creation and execution
65         # of the CREATE TABLE statement
66         fd, tmpfile = tempfile.mkstemp(dir=self.directory)
67         # We'll be managing this file ourselves
68         os.close(fd)
69         # sqlite doesn't close its fd with its contextmanager >.<
70         # contextlib.closing fixes this.
71         # See: http://stackoverflow.com/a/28032829/812183
72         with contextlib.closing(sqlite3.connect(tmpfile)) as db:
73             db.executescript(
74                 'CREATE TABLE repos ('
75                 '    repo CHAR(255) NOT NULL,'
76                 '    ref CHAR(255) NOT NULL,'
77                 '    path CHAR(255) NOT NULL,'
78                 '    PRIMARY KEY (repo, ref)'
79                 ');',
80             )
81 
82         # Atomic file move
83         os.rename(tmpfile, self.db_path)
84 
85     def _create(self):
86         if not os.path.exists(self.directory):
87             os.makedirs(self.directory)
88             self._write_readme()
89 
90         if os.path.exists(self.db_path):
91             return
92         with self.exclusive_lock():
93             # Another process may have already completed this work
94             if os.path.exists(self.db_path):  # pragma: no cover (race)
95                 return
96             self._write_sqlite_db()
97 
98     def require_created(self):
99         """Require the pre-commit file store to be created."""
100         if not self.__created:
101             self._create()
102             self.__created = True
103 
104     def _new_repo(self, repo, ref, make_strategy):
105         self.require_created()
106 
107         def _get_result():
108             # Check if we already exist
109             with sqlite3.connect(self.db_path) as db:
110                 result = db.execute(
111                     'SELECT path FROM repos WHERE repo = ? AND ref = ?',
112                     [repo, ref],
113                 ).fetchone()
114                 if result:
115                     return result[0]
116 
117         result = _get_result()
118         if result:
119             return result
120         with self.exclusive_lock():
121             # Another process may have already completed this work
122             result = _get_result()
123             if result:  # pragma: no cover (race)
124                 return result
125 
126             logger.info('Initializing environment for {}.'.format(repo))
127 
128             directory = tempfile.mkdtemp(prefix='repo', dir=self.directory)
129             with clean_path_on_failure(directory):
130                 make_strategy(directory)
131 
132             # Update our db with the created repo
133             with sqlite3.connect(self.db_path) as db:
134                 db.execute(
135                     'INSERT INTO repos (repo, ref, path) VALUES (?, ?, ?)',
136                     [repo, ref, directory],
137                 )
138         return directory
139 
140     def clone(self, repo, ref):
141         """Clone the given url and checkout the specific ref."""
142         def clone_strategy(directory):
143             cmd_output(
144                 'git', 'clone', '--no-checkout', repo, directory,
145                 env=no_git_env(),
146             )
147             with cwd(directory):
148                 cmd_output('git', 'reset', ref, '--hard', env=no_git_env())
149                 cmd_output(
150                     'git', 'submodule', 'update', '--init', '--recursive',
151                     env=no_git_env(),
152                 )
153 
154         return self._new_repo(repo, ref, clone_strategy)
155 
156     def make_local(self, deps):
157         def make_local_strategy(directory):
158             copy_tree_to_path(resource_filename('empty_template'), directory)
159         return self._new_repo(
160             'local:{}'.format(','.join(sorted(deps))), C.LOCAL_REPO_VERSION,
161             make_local_strategy,
162         )
163 
164     @cached_property
165     def db_path(self):
166         return os.path.join(self.directory, 'db.db')
167
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/pre_commit/store.py b/pre_commit/store.py
--- a/pre_commit/store.py
+++ b/pre_commit/store.py
@@ -156,6 +156,21 @@
     def make_local(self, deps):
         def make_local_strategy(directory):
             copy_tree_to_path(resource_filename('empty_template'), directory)
+
+            env = no_git_env()
+            name, email = 'pre-commit', 'asottile+pre-commit@umich.edu'
+            env['GIT_AUTHOR_NAME'] = env['GIT_COMMITTER_NAME'] = name
+            env['GIT_AUTHOR_EMAIL'] = env['GIT_COMMITTER_EMAIL'] = email
+
+            # initialize the git repository so it looks more like cloned repos
+            def _git_cmd(*args):
+                cmd_output('git', '-C', directory, *args, env=env)
+
+            _git_cmd('init', '.')
+            _git_cmd('config', 'remote.origin.url', '<<unknown>>')
+            _git_cmd('add', '.')
+            _git_cmd('commit', '--no-edit', '--no-gpg-sign', '-n', '-minit')
+
         return self._new_repo(
             'local:{}'.format(','.join(sorted(deps))), C.LOCAL_REPO_VERSION,
             make_local_strategy,

{"golden_diff": "diff --git a/pre_commit/store.py b/pre_commit/store.py\n--- a/pre_commit/store.py\n+++ b/pre_commit/store.py\n@@ -156,6 +156,21 @@\n     def make_local(self, deps):\n         def make_local_strategy(directory):\n             copy_tree_to_path(resource_filename('empty_template'), directory)\n+\n+            env = no_git_env()\n+            name, email = 'pre-commit', 'asottile+pre-commit@umich.edu'\n+            env['GIT_AUTHOR_NAME'] = env['GIT_COMMITTER_NAME'] = name\n+            env['GIT_AUTHOR_EMAIL'] = env['GIT_COMMITTER_EMAIL'] = email\n+\n+            # initialize the git repository so it looks more like cloned repos\n+            def _git_cmd(*args):\n+                cmd_output('git', '-C', directory, *args, env=env)\n+\n+            _git_cmd('init', '.')\n+            _git_cmd('config', 'remote.origin.url', '<<unknown>>')\n+            _git_cmd('add', '.')\n+            _git_cmd('commit', '--no-edit', '--no-gpg-sign', '-n', '-minit')\n+\n         return self._new_repo(\n             'local:{}'.format(','.join(sorted(deps))), C.LOCAL_REPO_VERSION,\n             make_local_strategy,\n", "issue": "Crash on `local`-only `golang` repositories\nWhile investigating: https://github.com/pre-commit/pre-commit-hooks/issues/255\r\n\r\nUsing this configuration:\r\n\r\n```yaml\r\nrepos:\r\n-   repo: local\r\n    hooks:\r\n    -   id: talisman\r\n        name: talisman\r\n        entry: talisman -githook pre-commit\r\n        pass_filenames: false\r\n        types: [text]\r\n        language: golang\r\n        additional_dependencies: [github.com/thoughtworks/talisman]\r\n```\r\n\r\n```\r\n$ pre-commit run --all-files\r\n[INFO] Initializing environment for local:github.com/thoughtworks/talisman.\r\n[INFO] Installing environment for local.\r\n[INFO] Once installed this environment will be reused.\r\n[INFO] This may take a few minutes...\r\nAn unexpected error has occurred: CalledProcessError: Command: ('/usr/bin/git', 'config', 'remote.origin.url')\r\nReturn code: 1\r\nExpected return code: 0\r\nOutput: (none)\r\nErrors: (none)\r\n\r\nCheck the log at /home/asottile/.cache/pre-commit/pre-commit.log\r\n```\r\n\r\n```\r\nAn unexpected error has occurred: CalledProcessError: Command: ('/usr/bin/git', 'config', 'remote.origin.url')\r\nReturn code: 1\r\nExpected return code: 0\r\nOutput: (none)\r\nErrors: (none)\r\n\r\nTraceback (most recent call last):\r\n  File \"/tmp/wat/venv/local/lib/python2.7/site-packages/pre_commit/error_handler.py\", line 47, in error_handler\r\n    yield\r\n  File \"/tmp/wat/venv/local/lib/python2.7/site-packages/pre_commit/main.py\", line 259, in main\r\n    return run(runner, args)\r\n  File \"/tmp/wat/venv/local/lib/python2.7/site-packages/pre_commit/commands/run.py\", line 256, in run\r\n    repo.require_installed()\r\n  File \"/tmp/wat/venv/local/lib/python2.7/site-packages/pre_commit/repository.py\", line 202, in require_installed\r\n    _install_all(self._venvs, self.repo_config['repo'], self.store)\r\n  File \"/tmp/wat/venv/local/lib/python2.7/site-packages/pre_commit/repository.py\", line 102, in _install_all\r\n    language.install_environment(cmd_runner, version, deps)\r\n  File \"/tmp/wat/venv/local/lib/python2.7/site-packages/pre_commit/languages/golang.py\", line 60, in install_environment\r\n    remote = git.get_remote_url(repo_cmd_runner.path())\r\n  File \"/tmp/wat/venv/local/lib/python2.7/site-packages/pre_commit/git.py\", line 41, in get_remote_url\r\n    ret = cmd_output('git', 'config', 'remote.origin.url', cwd=git_root)[1]\r\n  File \"/tmp/wat/venv/local/lib/python2.7/site-packages/pre_commit/util.py\", line 188, in cmd_output\r\n    returncode, cmd, retcode, output=(stdout, stderr),\r\nCalledProcessError: Command: ('/usr/bin/git', 'config', 'remote.origin.url')\r\nReturn code: 1\r\nExpected return code: 0\r\nOutput: (none)\r\nErrors: (none)\r\n```\n", "before_files": [{"content": "from __future__ import unicode_literals\n\nimport contextlib\nimport io\nimport logging\nimport os.path\nimport sqlite3\nimport tempfile\n\nfrom cached_property import cached_property\n\nimport pre_commit.constants as C\nfrom pre_commit import file_lock\nfrom pre_commit.util import clean_path_on_failure\nfrom pre_commit.util import cmd_output\nfrom pre_commit.util import copy_tree_to_path\nfrom pre_commit.util import cwd\nfrom pre_commit.util import no_git_env\nfrom pre_commit.util import resource_filename\n\n\nlogger = logging.getLogger('pre_commit')\n\n\ndef _get_default_directory():\n    \"\"\"Returns the default directory for the Store.  This is intentionally\n    underscored to indicate that `Store.get_default_directory` is the intended\n    way to get this information.  This is also done so\n    `Store.get_default_directory` can be mocked in tests and\n    `_get_default_directory` can be tested.\n    \"\"\"\n    return os.environ.get('PRE_COMMIT_HOME') or os.path.join(\n        os.environ.get('XDG_CACHE_HOME') or os.path.expanduser('~/.cache'),\n        'pre-commit',\n    )\n\n\nclass Store(object):\n    get_default_directory = staticmethod(_get_default_directory)\n    __created = False\n\n    def __init__(self, directory=None):\n        if directory is None:\n            directory = self.get_default_directory()\n\n        self.directory = directory\n\n    @contextlib.contextmanager\n    def exclusive_lock(self):\n        def blocked_cb():  # pragma: no cover (tests are single-process)\n            logger.info('Locking pre-commit directory')\n\n        with file_lock.lock(os.path.join(self.directory, '.lock'), blocked_cb):\n            yield\n\n    def _write_readme(self):\n        with io.open(os.path.join(self.directory, 'README'), 'w') as readme:\n            readme.write(\n                'This directory is maintained by the pre-commit project.\\n'\n                'Learn more: https://github.com/pre-commit/pre-commit\\n',\n            )\n\n    def _write_sqlite_db(self):\n        # To avoid a race where someone ^Cs between db creation and execution\n        # of the CREATE TABLE statement\n        fd, tmpfile = tempfile.mkstemp(dir=self.directory)\n        # We'll be managing this file ourselves\n        os.close(fd)\n        # sqlite doesn't close its fd with its contextmanager >.<\n        # contextlib.closing fixes this.\n        # See: http://stackoverflow.com/a/28032829/812183\n        with contextlib.closing(sqlite3.connect(tmpfile)) as db:\n            db.executescript(\n                'CREATE TABLE repos ('\n                '    repo CHAR(255) NOT NULL,'\n                '    ref CHAR(255) NOT NULL,'\n                '    path CHAR(255) NOT NULL,'\n                '    PRIMARY KEY (repo, ref)'\n                ');',\n            )\n\n        # Atomic file move\n        os.rename(tmpfile, self.db_path)\n\n    def _create(self):\n        if not os.path.exists(self.directory):\n            os.makedirs(self.directory)\n            self._write_readme()\n\n        if os.path.exists(self.db_path):\n            return\n        with self.exclusive_lock():\n            # Another process may have already completed this work\n            if os.path.exists(self.db_path):  # pragma: no cover (race)\n                return\n            self._write_sqlite_db()\n\n    def require_created(self):\n        \"\"\"Require the pre-commit file store to be created.\"\"\"\n        if not self.__created:\n            self._create()\n            self.__created = True\n\n    def _new_repo(self, repo, ref, make_strategy):\n        self.require_created()\n\n        def _get_result():\n            # Check if we already exist\n            with sqlite3.connect(self.db_path) as db:\n                result = db.execute(\n                    'SELECT path FROM repos WHERE repo = ? AND ref = ?',\n                    [repo, ref],\n                ).fetchone()\n                if result:\n                    return result[0]\n\n        result = _get_result()\n        if result:\n            return result\n        with self.exclusive_lock():\n            # Another process may have already completed this work\n            result = _get_result()\n            if result:  # pragma: no cover (race)\n                return result\n\n            logger.info('Initializing environment for {}.'.format(repo))\n\n            directory = tempfile.mkdtemp(prefix='repo', dir=self.directory)\n            with clean_path_on_failure(directory):\n                make_strategy(directory)\n\n            # Update our db with the created repo\n            with sqlite3.connect(self.db_path) as db:\n                db.execute(\n                    'INSERT INTO repos (repo, ref, path) VALUES (?, ?, ?)',\n                    [repo, ref, directory],\n                )\n        return directory\n\n    def clone(self, repo, ref):\n        \"\"\"Clone the given url and checkout the specific ref.\"\"\"\n        def clone_strategy(directory):\n            cmd_output(\n                'git', 'clone', '--no-checkout', repo, directory,\n                env=no_git_env(),\n            )\n            with cwd(directory):\n                cmd_output('git', 'reset', ref, '--hard', env=no_git_env())\n                cmd_output(\n                    'git', 'submodule', 'update', '--init', '--recursive',\n                    env=no_git_env(),\n                )\n\n        return self._new_repo(repo, ref, clone_strategy)\n\n    def make_local(self, deps):\n        def make_local_strategy(directory):\n            copy_tree_to_path(resource_filename('empty_template'), directory)\n        return self._new_repo(\n            'local:{}'.format(','.join(sorted(deps))), C.LOCAL_REPO_VERSION,\n            make_local_strategy,\n        )\n\n    @cached_property\n    def db_path(self):\n        return os.path.join(self.directory, 'db.db')\n", "path": "pre_commit/store.py"}], "after_files": [{"content": "from __future__ import unicode_literals\n\nimport contextlib\nimport io\nimport logging\nimport os.path\nimport sqlite3\nimport tempfile\n\nfrom cached_property import cached_property\n\nimport pre_commit.constants as C\nfrom pre_commit import file_lock\nfrom pre_commit.util import clean_path_on_failure\nfrom pre_commit.util import cmd_output\nfrom pre_commit.util import copy_tree_to_path\nfrom pre_commit.util import cwd\nfrom pre_commit.util import no_git_env\nfrom pre_commit.util import resource_filename\n\n\nlogger = logging.getLogger('pre_commit')\n\n\ndef _get_default_directory():\n    \"\"\"Returns the default directory for the Store.  This is intentionally\n    underscored to indicate that `Store.get_default_directory` is the intended\n    way to get this information.  This is also done so\n    `Store.get_default_directory` can be mocked in tests and\n    `_get_default_directory` can be tested.\n    \"\"\"\n    return os.environ.get('PRE_COMMIT_HOME') or os.path.join(\n        os.environ.get('XDG_CACHE_HOME') or os.path.expanduser('~/.cache'),\n        'pre-commit',\n    )\n\n\nclass Store(object):\n    get_default_directory = staticmethod(_get_default_directory)\n    __created = False\n\n    def __init__(self, directory=None):\n        if directory is None:\n            directory = self.get_default_directory()\n\n        self.directory = directory\n\n    @contextlib.contextmanager\n    def exclusive_lock(self):\n        def blocked_cb():  # pragma: no cover (tests are single-process)\n            logger.info('Locking pre-commit directory')\n\n        with file_lock.lock(os.path.join(self.directory, '.lock'), blocked_cb):\n            yield\n\n    def _write_readme(self):\n        with io.open(os.path.join(self.directory, 'README'), 'w') as readme:\n            readme.write(\n                'This directory is maintained by the pre-commit project.\\n'\n                'Learn more: https://github.com/pre-commit/pre-commit\\n',\n            )\n\n    def _write_sqlite_db(self):\n        # To avoid a race where someone ^Cs between db creation and execution\n        # of the CREATE TABLE statement\n        fd, tmpfile = tempfile.mkstemp(dir=self.directory)\n        # We'll be managing this file ourselves\n        os.close(fd)\n        # sqlite doesn't close its fd with its contextmanager >.<\n        # contextlib.closing fixes this.\n        # See: http://stackoverflow.com/a/28032829/812183\n        with contextlib.closing(sqlite3.connect(tmpfile)) as db:\n            db.executescript(\n                'CREATE TABLE repos ('\n                '    repo CHAR(255) NOT NULL,'\n                '    ref CHAR(255) NOT NULL,'\n                '    path CHAR(255) NOT NULL,'\n                '    PRIMARY KEY (repo, ref)'\n                ');',\n            )\n\n        # Atomic file move\n        os.rename(tmpfile, self.db_path)\n\n    def _create(self):\n        if not os.path.exists(self.directory):\n            os.makedirs(self.directory)\n            self._write_readme()\n\n        if os.path.exists(self.db_path):\n            return\n        with self.exclusive_lock():\n            # Another process may have already completed this work\n            if os.path.exists(self.db_path):  # pragma: no cover (race)\n                return\n            self._write_sqlite_db()\n\n    def require_created(self):\n        \"\"\"Require the pre-commit file store to be created.\"\"\"\n        if not self.__created:\n            self._create()\n            self.__created = True\n\n    def _new_repo(self, repo, ref, make_strategy):\n        self.require_created()\n\n        def _get_result():\n            # Check if we already exist\n            with sqlite3.connect(self.db_path) as db:\n                result = db.execute(\n                    'SELECT path FROM repos WHERE repo = ? AND ref = ?',\n                    [repo, ref],\n                ).fetchone()\n                if result:\n                    return result[0]\n\n        result = _get_result()\n        if result:\n            return result\n        with self.exclusive_lock():\n            # Another process may have already completed this work\n            result = _get_result()\n            if result:  # pragma: no cover (race)\n                return result\n\n            logger.info('Initializing environment for {}.'.format(repo))\n\n            directory = tempfile.mkdtemp(prefix='repo', dir=self.directory)\n            with clean_path_on_failure(directory):\n                make_strategy(directory)\n\n            # Update our db with the created repo\n            with sqlite3.connect(self.db_path) as db:\n                db.execute(\n                    'INSERT INTO repos (repo, ref, path) VALUES (?, ?, ?)',\n                    [repo, ref, directory],\n                )\n        return directory\n\n    def clone(self, repo, ref):\n        \"\"\"Clone the given url and checkout the specific ref.\"\"\"\n        def clone_strategy(directory):\n            cmd_output(\n                'git', 'clone', '--no-checkout', repo, directory,\n                env=no_git_env(),\n            )\n            with cwd(directory):\n                cmd_output('git', 'reset', ref, '--hard', env=no_git_env())\n                cmd_output(\n                    'git', 'submodule', 'update', '--init', '--recursive',\n                    env=no_git_env(),\n                )\n\n        return self._new_repo(repo, ref, clone_strategy)\n\n    def make_local(self, deps):\n        def make_local_strategy(directory):\n            copy_tree_to_path(resource_filename('empty_template'), directory)\n\n            env = no_git_env()\n            name, email = 'pre-commit', 'asottile+pre-commit@umich.edu'\n            env['GIT_AUTHOR_NAME'] = env['GIT_COMMITTER_NAME'] = name\n            env['GIT_AUTHOR_EMAIL'] = env['GIT_COMMITTER_EMAIL'] = email\n\n            # initialize the git repository so it looks more like cloned repos\n            def _git_cmd(*args):\n                cmd_output('git', '-C', directory, *args, env=env)\n\n            _git_cmd('init', '.')\n            _git_cmd('config', 'remote.origin.url', '<<unknown>>')\n            _git_cmd('add', '.')\n            _git_cmd('commit', '--no-edit', '--no-gpg-sign', '-n', '-minit')\n\n        return self._new_repo(\n            'local:{}'.format(','.join(sorted(deps))), C.LOCAL_REPO_VERSION,\n            make_local_strategy,\n        )\n\n    @cached_property\n    def db_path(self):\n        return os.path.join(self.directory, 'db.db')\n", "path": "pre_commit/store.py"}]}