diff options
author | Markus Lehtonen <markus.lehtonen@linux.intel.com> | 2014-02-05 16:11:42 +0200 |
---|---|---|
committer | Markus Lehtonen <markus.lehtonen@linux.intel.com> | 2014-06-05 14:20:03 +0300 |
commit | ed4f98fb213dd5600ffd5b128f935c65a5ebb29b (patch) | |
tree | f496cadc97898b5d673a7a3c8797d05fb3b02ebb /gbp/git | |
parent | d276ea51e567520e395393eae04a93bff0d91188 (diff) | |
download | git-buildpackage-ed4f98fb213dd5600ffd5b128f935c65a5ebb29b.tar.gz git-buildpackage-ed4f98fb213dd5600ffd5b128f935c65a5ebb29b.tar.bz2 git-buildpackage-ed4f98fb213dd5600ffd5b128f935c65a5ebb29b.zip |
GitRepository.commit_files: add committer_info argument
For setting the committer name/email/date - similarly to author_info.
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Diffstat (limited to 'gbp/git')
-rw-r--r-- | gbp/git/repository.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/gbp/git/repository.py b/gbp/git/repository.py index 2b1e4605..f705f616 100644 --- a/gbp/git/repository.py +++ b/gbp/git/repository.py @@ -1363,8 +1363,11 @@ class GitRepository(object): #{ Comitting - def _commit(self, msg, args=[], author_info=None, edit=False): + def _commit(self, msg, args=[], author_info=None, + committer_info=None, edit=False): extra_env = author_info.get_author_env() if author_info else None + if committer_info: + extra_env.update(committer_info.get_committer_env()) default_args = ['-q', '-m', msg] + (['--edit'] if edit else []) self._git_command("commit", default_args + args, extra_env=extra_env, interactive=edit) @@ -1392,7 +1395,7 @@ class GitRepository(object): """ self._commit(msg=msg, args=['-a'], author_info=author_info, edit=edit) - def commit_files(self, files, msg, author_info=None): + def commit_files(self, files, msg, author_info=None, committer_info=None): """ Commit the given files to the repository @@ -1402,10 +1405,13 @@ class GitRepository(object): @type msg: C{str} @param author_info: authorship information @type author_info: L{GitModifier} + @param committer_info: committer information + @type committer_info: L{GitModifier} """ if isinstance(files, basestring): files = [ files ] - self._commit(msg=msg, args=files, author_info=author_info) + self._commit(msg=msg, args=files, author_info=author_info, + committer_info=committer_info) def create_tree(self, unpack_dir): """ |