Beispiel #1
0
    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
Beispiel #2
0
def test_git_shell():
    assert "usage: git" in shell([GIT_PATH, "help"])
Beispiel #3
0
def test_git_shell():
    assert "See 'git help git' for an overview of the system." in shell(
        ["git", "--help"])