Fix autoupdate to always use non-shallow clone

This commit is contained in:
Anthony Sottile
2019-07-20 14:19:46 -07:00
parent 95afd642f5
commit 73250ff4e3
4 changed files with 29 additions and 21 deletions

View File

@@ -143,6 +143,15 @@ def has_diff(*args, **kwargs):
return cmd_output(*cmd, cwd=repo, retcode=None)[0]
def init_repo(path, remote):
if os.path.isdir(remote):
remote = os.path.abspath(remote)
env = no_git_env()
cmd_output('git', 'init', path, env=env)
cmd_output('git', 'remote', 'add', 'origin', remote, cwd=path, env=env)
def commit(repo='.'):
env = no_git_env()
name, email = 'pre-commit', 'asottile+pre-commit@umich.edu'