| Total Complexity | 4 |
| Total Lines | 14 |
| Duplicated Lines | 0 % |
| Changes | 3 | ||
| Bugs | 0 | Features | 1 |
| 1 | import git |
||
| 5 | class Updater(object): |
||
| 6 | def __init__(self, is_develop): |
||
| 7 | self.repo = git.Repo(os.getcwd()) |
||
| 8 | self.branch = 'origin/master' if not is_develop else 'origin/develop' |
||
| 9 | |||
| 10 | def check(self): |
||
| 11 | self.repo.remote().fetch() |
||
| 12 | |||
| 13 | diff = self.repo.index.diff(self.branch) |
||
| 14 | return bool(diff) |
||
| 15 | |||
| 16 | def update(self): |
||
| 17 | # todo pull from branch |
||
| 18 | self.repo.remote().pull() |
||
| 19 |