From a46f11ac8e56f5962e7a21e2c4fffd1ba9fe4ede Mon Sep 17 00:00:00 2001 From: mtkennerly Date: Fri, 16 Feb 2024 14:45:23 -0500 Subject: [PATCH] Limit test to newer Git versions --- tests/integration/test_dunamai.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/integration/test_dunamai.py b/tests/integration/test_dunamai.py index ea1af52..275af7a 100644 --- a/tests/integration/test_dunamai.py +++ b/tests/integration/test_dunamai.py @@ -491,6 +491,9 @@ def test__version__from_git__exclude_decoration(tmp_path) -> None: assert from_vcs() == Version("0.1.0", dirty=False, branch=b) +# Older versions of Git fail with code 128: +# "fatal: missing object 0000000000000000000000000000000000000000 for refs/tags/bad.txt" +@pytest.mark.skipif(lacks_git_version([2, 7]), reason="Requires Git 2.7+") def test__version__from_git__broken_ref(tmp_path) -> None: vcs = tmp_path / "dunamai-git-broken-ref" vcs.mkdir()