aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMaximilian Hils <git@maximilianhils.com>2020-06-19 17:34:22 +0200
committerGitHub <noreply@github.com>2020-06-19 17:34:22 +0200
commit8e5c62c1691b842ca2032cc8ac4d4ca5d0be8490 (patch)
tree82e6014ac58ebce2c22fd64de10284dfc47b7c3d
parent31a6f60e4597b695d3ad03d7d98eb4fd6c4d5858 (diff)
parent054d77fb483d839345c011ee1163657d163647c0 (diff)
downloadmitmproxy-8e5c62c1691b842ca2032cc8ac4d4ca5d0be8490.tar.gz
mitmproxy-8e5c62c1691b842ca2032cc8ac4d4ca5d0be8490.tar.bz2
mitmproxy-8e5c62c1691b842ca2032cc8ac4d4ca5d0be8490.zip
Merge pull request #4036 from JustAnotherArchivist/dev-version-detectionHEADmaster
Verify that we're in the correct repository when extracting dev version information
-rw-r--r--mitmproxy/version.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/mitmproxy/version.py b/mitmproxy/version.py
index 82368296..f14eb697 100644
--- a/mitmproxy/version.py
+++ b/mitmproxy/version.py
@@ -20,6 +20,13 @@ def get_dev_version() -> str:
here = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
try:
+ # Check that we're in the mitmproxy repository: https://github.com/mitmproxy/mitmproxy/issues/3987
+ subprocess.run(
+ ['git', 'cat-file', '-t', 'cb0e3287090786fad566feb67ac07b8ef361b2c3'],
+ stdout=subprocess.DEVNULL,
+ stderr=subprocess.DEVNULL,
+ cwd=here,
+ check=True)
git_describe = subprocess.check_output(
['git', 'describe', '--tags', '--long'],
stderr=subprocess.STDOUT,