def patch(self) -> str: """ Get the change patch for the commit. """ if self._patch is None: if self.sha: self._patch = shell([GIT_PATH, "show", self.sha]) else: self._patch = shell([GIT_PATH, "diff", "--cached"]) return self._patch
def test_git_shell(): assert "usage: git" in shell([GIT_PATH, "help"])
def test_git_shell(): assert "See 'git help git' for an overview of the system." in shell( ["git", "--help"])