Replace git cat-file -t with -e and explain the magic ID

This commit is contained in:
JustAnotherArchivist 2020-06-21 22:12:20 +00:00
parent 65cce78481
commit 9b6198a1fe

View file

@ -21,8 +21,9 @@ 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
# cb0e3287090786fad566feb67ac07b8ef361b2c3 is the first mitmproxy commit.
subprocess.run(
['git', 'cat-file', '-t', 'cb0e3287090786fad566feb67ac07b8ef361b2c3'],
['git', 'cat-file', '-e', 'cb0e3287090786fad566feb67ac07b8ef361b2c3'],
stdout=subprocess.DEVNULL,
stderr=subprocess.DEVNULL,
cwd=here,