Skip to content

Commit 31ccc19

Browse files
committed
Encode the 'local hooks repo' version into the store
1 parent 927f471 commit 31ccc19

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

pre_commit/constants.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717

1818
# Bump when installation changes in a backwards / forwards incompatible way
1919
INSTALLED_STATE_VERSION = '1'
20+
# Bump when modifying `empty_template`
21+
LOCAL_REPO_VERSION = '1'
2022

2123
VERSION = pkg_resources.get_distribution('pre-commit').version
2224
VERSION_PARSED = pkg_resources.parse_version(VERSION)

pre_commit/store.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
from cached_property import cached_property
1111

12+
import pre_commit.constants as C
1213
from pre_commit.prefixed_command_runner import PrefixedCommandRunner
1314
from pre_commit.util import clean_path_on_failure
1415
from pre_commit.util import cmd_output
@@ -129,7 +130,7 @@ def make_local(self, deps):
129130
def make_local_strategy(directory):
130131
copy_tree_to_path(resource_filename('empty_template'), directory)
131132
return self._new_repo(
132-
'local:{}'.format(','.join(sorted(deps))), 'N/A',
133+
'local:{}'.format(','.join(sorted(deps))), C.LOCAL_REPO_VERSION,
133134
make_local_strategy,
134135
)
135136

0 commit comments

Comments
 (0)