summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJürg Billeter <j@bitron.ch>2017-07-07 08:11:45 +0200
committerJürg Billeter <j@bitron.ch>2017-07-14 10:26:34 +0200
commit636d217bacf2cbf2399ae3c7ed55f462d2b6016e (patch)
tree91d0fa5ba6481b9d6505ee07cd382d6471caf369
parent5d24f6ea0ca8b660404c43d81b2cf153a3c42764 (diff)
downloadbuildstream-636d217bacf2cbf2399ae3c7ed55f462d2b6016e.tar.gz
_ostree.py: Support branches in commit()
-rw-r--r--buildstream/_ostree.py7
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: