From 457dc6ab896e2bc88253aae901aaf221ffc7136b Mon Sep 17 00:00:00 2001 From: nathaniel smith Date: Sun, 24 Sep 2017 23:54:45 -0700 Subject: [PATCH] use gitpython for dirty check --- tildewiki/git_wrapper.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tildewiki/git_wrapper.py b/tildewiki/git_wrapper.py index 869b18c..44f1adc 100644 --- a/tildewiki/git_wrapper.py +++ b/tildewiki/git_wrapper.py @@ -23,10 +23,10 @@ def create_repo(to_clone, local_path, author_name, author_email): repo.config['user.name'] = author_name repo.config['user.email'] = author_email -def dirty(repo_path): - # TODO figure out how to do with GitPython - repo = pygit2.Repository(repo_path) - return repo.status() != {} +def dirty(repo_path:str): + repo = gitpython.Repo(repo_path) + status = repo.git.status() + return 'nothing to commit, working directory clean' not in status def make_commit(repo_path, author_name, author_email): """Given a path to a repository, adds everything and commits it. If there