(self, message: str, tag: str | None = None)
| 36 | pass # already committed |
| 37 | |
| 38 | def commit(self, message: str, tag: str | None = None) -> None: |
| 39 | self._git("add", "-A") |
| 40 | try: |
| 41 | self._git("commit", "-m", message) |
| 42 | logger.info("Committed: %s", message) |
| 43 | except RuntimeError: |
| 44 | logger.debug("Nothing to commit: %s", message) |
| 45 | if tag: |
| 46 | self._git("tag", "-f", tag) |
| 47 | logger.debug("Tagged: %s", tag) |
| 48 | |
| 49 | def rollback(self, ref: str = "HEAD~1") -> None: |
| 50 | """Restore workspace content from *ref* as a NEW commit. |