Skip to content

Commit

Permalink
Filling out git repo provider impl (#350)
Browse files Browse the repository at this point in the history
  • Loading branch information
mwatts15 committed Jun 16, 2018
1 parent d22281c commit 116c551
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions PyOpenWorm/git_repo.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,25 @@ class GitRepoProvider(object):

def __init__(self):
self._repo = None
self.base = None

def init(self, base=None):
base = self.base if not base else base
self._repo = Repo.init(base)

def add(self, files):
self.repo().index.add(files)

def remove(self, files, recursive=False):
self.repo().index.remove(files, r=recursive)

def reset(self):
self.repo().index.reset()

def commit(self, msg):
self.repo().index.commit(msg)

def repo(self):
if self._repo is None:
self._repo = Repo(self.base)
return self._repo

0 comments on commit 116c551

Please sign in to comment.