diff --git a/mitmproxy/version.py b/mitmproxy/version.py index 63fb7bf93..82368296b 100644 --- a/mitmproxy/version.py +++ b/mitmproxy/version.py @@ -21,7 +21,7 @@ def get_dev_version() -> str: here = os.path.abspath(os.path.join(os.path.dirname(__file__), "..")) try: git_describe = subprocess.check_output( - ['git', 'describe', '--long'], + ['git', 'describe', '--tags', '--long'], stderr=subprocess.STDOUT, cwd=here, ) diff --git a/test/mitmproxy/test_version.py b/test/mitmproxy/test_version.py index 924f2d961..c0722537d 100644 --- a/test/mitmproxy/test_version.py +++ b/test/mitmproxy/test_version.py @@ -30,5 +30,5 @@ def test_get_version(): m.return_value = b"tag-2-cafecafe" assert version.get_dev_version() == "3.0.0rc2 (+2, commit cafecaf)" - m.side_effect = subprocess.CalledProcessError(-1, 'git describe --long') + m.side_effect = subprocess.CalledProcessError(-1, 'git describe --tags --long') assert version.get_dev_version() == "3.0.0rc2"