summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2018-03-19 16:12:00 +0900
committerTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2018-03-20 18:29:14 +0900
commit0f6b75dc7e7508c2806c92326d725ff4a777362e (patch)
tree7866b3c0ab09537776b51a204fb7e80ce756b4ff
parent83a18f9856b346f2686fcf8857a4458b312137e9 (diff)
downloadbuildstream-0f6b75dc7e7508c2806c92326d725ff4a777362e.tar.gz
testutils/repo/git.py: Added branch() method
In order to test tracking on multiple branches, lets use the Git repo scaffolding.
-rw-r--r--tests/testutils/repo/git.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/tests/testutils/repo/git.py b/tests/testutils/repo/git.py
index 2a20bc331..9d527f904 100644
--- a/tests/testutils/repo/git.py
+++ b/tests/testutils/repo/git.py
@@ -68,3 +68,6 @@ class Git(Repo):
'git', 'rev-parse', 'master'
], env=GIT_ENV, cwd=self.repo)
return output.decode('UTF-8').strip()
+
+ def branch(self, branch_name):
+ subprocess.call(['git', 'checkout', '-b', branch_name], env=GIT_ENV, cwd=self.repo)