Skip to content

Commit

Permalink
Use the meta repository to compute the branch.
Browse files Browse the repository at this point in the history
  • Loading branch information
icemac authored and Michael Howitz committed Aug 23, 2023
1 parent 49beb02 commit 6e1fe29
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions config/shared/git.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
from .call import call
from .path import change_dir
import pathlib


def get_commit_id():
Expand All @@ -9,10 +11,14 @@ def get_commit_id():


def get_branch_name(override, config_type):
"""Get the default branch name but prefer override if not empty."""
return (
override
or f"config-with-{config_type}-template-{get_commit_id()}")
"""Get the default branch name but prefer override if not empty.
The commit ID is based on the meta repository.
"""
with change_dir(pathlib.Path(__file__).parent):
return (
override
or f"config-with-{config_type}-template-{get_commit_id()}")


def git_branch(branch_name) -> bool:
Expand Down

0 comments on commit 6e1fe29

Please sign in to comment.