mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-01-17 22:40:11 -06:00
fix pre-commit autoupdate for core.useBuiltinFSMonitor=true on windows
This commit is contained in:
@@ -12,9 +12,11 @@ from pre_commit.util import CalledProcessError
|
||||
from pre_commit.util import cmd_output
|
||||
from pre_commit.util import cmd_output_b
|
||||
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
# see #2046
|
||||
NO_FS_MONITOR = ('-c', 'core.useBuiltinFSMonitor=false')
|
||||
|
||||
|
||||
def zsplit(s: str) -> List[str]:
|
||||
s = s.strip('\0')
|
||||
@@ -185,10 +187,11 @@ def init_repo(path: str, remote: str) -> None:
|
||||
if os.path.isdir(remote):
|
||||
remote = os.path.abspath(remote)
|
||||
|
||||
git = ('git', *NO_FS_MONITOR)
|
||||
env = no_git_env()
|
||||
# avoid the user's template so that hooks do not recurse
|
||||
cmd_output_b('git', 'init', '--template=', path, env=env)
|
||||
cmd_output_b('git', 'remote', 'add', 'origin', remote, cwd=path, env=env)
|
||||
cmd_output_b(*git, 'init', '--template=', path, env=env)
|
||||
cmd_output_b(*git, 'remote', 'add', 'origin', remote, cwd=path, env=env)
|
||||
|
||||
|
||||
def commit(repo: str = '.') -> None:
|
||||
|
||||
Reference in New Issue
Block a user