diff options
Diffstat (limited to 'buildstream/_ostree.py')
-rw-r--r-- | buildstream/_ostree.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/buildstream/_ostree.py b/buildstream/_ostree.py index 81663b791..c165d5224 100644 --- a/buildstream/_ostree.py +++ b/buildstream/_ostree.py @@ -114,8 +114,9 @@ def checkout(repo, path, commit, user=False): # repo (OSTree.Repo): The repo # dir (str): The source directory to commit to the repo # ref (str): A symbolic reference (tag) for the commit +# branch (str): Optional branch for the commit # -def commit(repo, dir, ref): +def commit(repo, dir, ref, branch=None): def commit_filter(repo, path, file_info): @@ -146,6 +147,10 @@ def commit(repo, dir, ref): # create tag repo.transaction_set_ref(None, ref, rev) + # optionally create/update branch (without parent commit for now) + if branch: + repo.transaction_set_ref(None, branch, rev) + # complete repo transaction repo.commit_transaction(None) except: |