use gitpython for dirty check

master
nathaniel smith 2017-09-24 23:54:45 -07:00
parent e23db672e2
commit 457dc6ab89
1 changed files with 4 additions and 4 deletions

View File

@ -23,10 +23,10 @@ def create_repo(to_clone, local_path, author_name, author_email):
repo.config['user.name'] = author_name repo.config['user.name'] = author_name
repo.config['user.email'] = author_email repo.config['user.email'] = author_email
def dirty(repo_path): def dirty(repo_path:str):
# TODO figure out how to do with GitPython repo = gitpython.Repo(repo_path)
repo = pygit2.Repository(repo_path) status = repo.git.status()
return repo.status() != {} return 'nothing to commit, working directory clean' not in status
def make_commit(repo_path, author_name, author_email): def make_commit(repo_path, author_name, author_email):
"""Given a path to a repository, adds everything and commits it. If there """Given a path to a repository, adds everything and commits it. If there