summaryrefslogtreecommitdiffstats
path: root/pre_commit/git.py
diff options
context:
space:
mode:
Diffstat (limited to 'pre_commit/git.py')
-rw-r--r--pre_commit/git.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/pre_commit/git.py b/pre_commit/git.py
index 7e757f2..576bef8 100644
--- a/pre_commit/git.py
+++ b/pre_commit/git.py
@@ -158,7 +158,8 @@ def init_repo(path: str, remote: str) -> None:
remote = os.path.abspath(remote)
env = no_git_env()
- cmd_output_b('git', 'init', path, env=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)