(self)
| 24 | self.execute(cmd) |
| 25 | |
| 26 | def diff(self) -> Tuple[List[str], List[str]]: |
| 27 | cmd = ["git", "diff", "--name-status"] |
| 28 | out = self.execute(cmd) |
| 29 | adds = [] |
| 30 | mods = [] |
| 31 | for line in out.splitlines(): |
| 32 | line = line.strip() |
| 33 | if not line: |
| 34 | continue |
| 35 | tokens = line.split() |
| 36 | if tokens[0] == "A": |
| 37 | adds.append(tokens[1]) |
| 38 | elif tokens[0] == "M": |
| 39 | mods.append(tokens[1]) |
| 40 | return adds, mods |
| 41 | |
| 42 | def delete_branch(self, branch: str): |
| 43 | cmd = ["git", "branch", "-D", branch] |