Allow shallow cloning

This commit is contained in:
DanielChabrowski 2019-03-03 01:35:53 +01:00
parent aa4bc9d241
commit e74253d2de
3 changed files with 90 additions and 15 deletions

View file

@ -142,3 +142,8 @@ def git_commit(*args, **kwargs):
if msg is not None: # allow skipping `-m` with `msg=None`
cmd += ('-m', msg)
return fn(*cmd, **kwargs)
def git_ref_count(repo):
_, out, _ = cmd_output('git', 'rev-list', '--all', '--count', cwd=repo)
return int(out.split()[0])