Esempio n. 1
0
def test_branch_strips_refs(monkeypatch):
    """
    If a ref has multiple levels (including a slash),
    remove the levels and given the final element as the branch.
    """
    monkeypatch.setenv("GIT_BRANCH", "origin/master")
    assert Git("")._branch() == "master"
Esempio n. 2
0
def test_win32_is_repo(inp, out):
    """Fails when non-repo case is not detected for win32."""
    assert Git.is_repo(inp) == out
Esempio n. 3
0
def test_linux_is_repo(inp, out):
    """Fails when non-repo case is not detected for linux."""
    assert Git.is_repo(inp) == out
Esempio n. 4
0
def test_branch_envvar(monkeypatch):
    """GIT_BRANCH should set the branch as consumed by vcver. """
    monkeypatch.setenv("GIT_BRANCH", "master")
    assert Git("")._branch() == "master"