mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 00:04:42 +04:00
fix pre-commit autoupdate for core.useBuiltinFSMonitor=true on windows
This commit is contained in:
parent
2ef29b7f95
commit
ab94dd69f8
3 changed files with 32 additions and 8 deletions
|
|
@ -5,6 +5,7 @@ import pytest
|
|||
import yaml
|
||||
|
||||
import pre_commit.constants as C
|
||||
from pre_commit import envcontext
|
||||
from pre_commit import git
|
||||
from pre_commit import util
|
||||
from pre_commit.commands.autoupdate import _check_hooks_still_exist_at_rev
|
||||
|
|
@ -176,6 +177,14 @@ def test_autoupdate_out_of_date_repo(out_of_date, tmpdir, store):
|
|||
assert cfg.read() == fmt.format(out_of_date.path, out_of_date.head_rev)
|
||||
|
||||
|
||||
def test_autoupdate_with_core_useBuiltinFSMonitor(out_of_date, tmpdir, store):
|
||||
# force the setting on "globally" for git
|
||||
home = tmpdir.join('fakehome').ensure_dir()
|
||||
home.join('.gitconfig').write('[core]\nuseBuiltinFSMonitor = true\n')
|
||||
with envcontext.envcontext((('HOME', str(home)),)):
|
||||
test_autoupdate_out_of_date_repo(out_of_date, tmpdir, store)
|
||||
|
||||
|
||||
def test_autoupdate_pure_yaml(out_of_date, tmpdir, store):
|
||||
with mock.patch.object(util, 'Dumper', yaml.SafeDumper):
|
||||
test_autoupdate_out_of_date_repo(out_of_date, tmpdir, store)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue