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-02-07 14:25:26 +0200 |
commit | e4d82c65e9d95e50e6e7050d08c243ed2ac30a0f (patch) | |
tree | 316ccdfb2c183ab048bbeeae97b64ff332870a6a | |
parent | 1c5be59711dfb18f18293d7b17b2e237627293b1 (diff) | |
download | git-buildpackage-e4d82c65e9d95e50e6e7050d08c243ed2ac30a0f.tar.gz git-buildpackage-e4d82c65e9d95e50e6e7050d08c243ed2ac30a0f.tar.bz2 git-buildpackage-e4d82c65e9d95e50e6e7050d08c243ed2ac30a0f.zip |
GitRepository.commit_files: add committer_info argument
For setting the committer name/email/date - similarly to author_info.
Change-Id: I5f085eb5f23bacd7494620726024f09b48c23f19
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
-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 e6023494..40906b11 100644 --- a/gbp/git/repository.py +++ b/gbp/git/repository.py @@ -1436,8 +1436,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) @@ -1465,7 +1468,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 @@ -1475,10 +1478,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 commit_dir(self, unpack_dir, msg, branch, other_parents=None, author={}, committer={}, create_missing_branch=False): |