From 89c36757416e60d22400d1c326251ae04449ab7c Mon Sep 17 00:00:00 2001 From: Maximilian Hils Date: Sat, 21 Dec 2019 02:18:17 +0100 Subject: [PATCH] `mitmproxy --version`: incorporate non-annotated tags --- mitmproxy/version.py | 2 +- test/mitmproxy/test_version.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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"