summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2018-12-06 22:44:45 +0900
committerTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2018-12-06 23:18:31 +0900
commit50cb2706ff6b47235097dcdc87e16547f1753956 (patch)
tree70680c3c8392f7ec37d1df1ff9029d29aab62830
parent5fc9a1dae7cee661b5b30141afa15e8ad3c30434 (diff)
downloadbuildstream-50cb2706ff6b47235097dcdc87e16547f1753956.tar.gz
tests/testutils/repo/git.py: Adding remove_path() helper
A function for removing paths from a git repo, can also be used to remove submodules.
-rw-r--r--tests/testutils/repo/git.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/testutils/repo/git.py b/tests/testutils/repo/git.py
index fe3ebd547..b2d480975 100644
--- a/tests/testutils/repo/git.py
+++ b/tests/testutils/repo/git.py
@@ -76,6 +76,12 @@ class Git(Repo):
self._run_git('commit', '-m', 'Added the submodule')
return self.latest_commit()
+ # This can also be used to a file or a submodule
+ def remove_path(self, path):
+ self._run_git('rm', path)
+ self._run_git('commit', '-m', 'Removing {}'.format(path))
+ return self.latest_commit()
+
def source_config(self, ref=None, checkout_submodules=None):
config = {
'kind': 'git',