diff options
Diffstat (limited to 'tests/testutils/repo/git.py')
-rw-r--r-- | tests/testutils/repo/git.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/testutils/repo/git.py b/tests/testutils/repo/git.py index 8c2a8c177..c598eb4d0 100644 --- a/tests/testutils/repo/git.py +++ b/tests/testutils/repo/git.py @@ -52,6 +52,13 @@ class Git(Repo): self._run_git('commit', '-m', 'Added {}'.format(os.path.basename(filename))) return self.latest_commit() + def modify_file(self, new_file, path): + shutil.copy(new_file, os.path.join(self.repo, path)) + subprocess.call([ + 'git', 'commit', path, '-m', 'Modified {}'.format(os.path.basename(path)) + ], env=GIT_ENV, cwd=self.repo) + return self.latest_commit() + def add_submodule(self, subdir, url=None, checkout=None): submodule = {} if checkout is not None: |