diff options
author | Tristan Van Berkom <tristan.vanberkom@codethink.co.uk> | 2018-12-06 22:44:45 +0900 |
---|---|---|
committer | Tristan Van Berkom <tristan.vanberkom@codethink.co.uk> | 2018-12-06 23:18:31 +0900 |
commit | 50cb2706ff6b47235097dcdc87e16547f1753956 (patch) | |
tree | 70680c3c8392f7ec37d1df1ff9029d29aab62830 | |
parent | 5fc9a1dae7cee661b5b30141afa15e8ad3c30434 (diff) | |
download | buildstream-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.py | 6 |
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', |