mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-21 22:24:35 +00:00
Add support for using other rev than HEAD in git-ref.py.
This commit is contained in:
parent
821f2f907b
commit
87285cfcaa
@ -2,13 +2,19 @@
|
||||
|
||||
import filecmp
|
||||
import subprocess
|
||||
import sys
|
||||
import os
|
||||
|
||||
out = "GitRef.hpp"
|
||||
tmp = f"{out}.tmp"
|
||||
|
||||
if len(sys.argv) > 1:
|
||||
rev = sys.argv[1]
|
||||
else:
|
||||
rev = "HEAD"
|
||||
|
||||
try:
|
||||
ref = subprocess.run(["git", "rev-parse", "--short", "HEAD"], check=True, capture_output=True).stdout.decode().strip()
|
||||
ref = subprocess.run(["git", "rev-parse", "--short", rev], check=True, capture_output=True).stdout.decode().strip()
|
||||
except subprocess.CalledProcessError:
|
||||
ref = "unknown"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user