mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2025-02-02 00:05:27 +00:00
Verify that we're in the correct repository when extracting dev version information
Fixes #3987
This commit is contained in:
parent
31a6f60e45
commit
054d77fb48
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user