Skip to content

Commit

Permalink
Fix get_tag.py (The-OpenROAD-Project#1062)
Browse files Browse the repository at this point in the history
~ get_tag.py now returns the commit hash if the branch name is empty (i.e. in a detached HEAD state)
  • Loading branch information
donn authored Apr 18, 2022
1 parent 85b6cec commit 754b537
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions dependencies/get_tag.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,9 @@ def get_tag() -> str:
)

branch_name = branch_name_data.stdout.decode("utf8").strip()
if branch_name not in ["main", "master"]:
return f"{branch_name}-dev"
if branch_name != "":
if branch_name not in ["main", "master"]:
return f"{branch_name}-dev"

process_data: subprocess.CompletedProcess = subprocess.run(
["git", "rev-parse", "HEAD"],
Expand Down

0 comments on commit 754b537

Please sign in to comment.