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 filecmp
|
||||||
import subprocess
|
import subprocess
|
||||||
|
import sys
|
||||||
import os
|
import os
|
||||||
|
|
||||||
out = "GitRef.hpp"
|
out = "GitRef.hpp"
|
||||||
tmp = f"{out}.tmp"
|
tmp = f"{out}.tmp"
|
||||||
|
|
||||||
|
if len(sys.argv) > 1:
|
||||||
|
rev = sys.argv[1]
|
||||||
|
else:
|
||||||
|
rev = "HEAD"
|
||||||
|
|
||||||
try:
|
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:
|
except subprocess.CalledProcessError:
|
||||||
ref = "unknown"
|
ref = "unknown"
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user