From edd12bc8d2bba682ebbae807dfcb428b2d6f4c4e Mon Sep 17 00:00:00 2001 From: Markus Lehtonen Date: Wed, 5 Feb 2014 16:11:42 +0200 Subject: GitRepository.commit_files: add edit argument In order to be able to spawn an editor, similarly to other commitX methods in GitRepository. Signed-off-by: Markus Lehtonen --- gbp/git/repository.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'gbp/git/repository.py') diff --git a/gbp/git/repository.py b/gbp/git/repository.py index 61ed500e..b6456954 100644 --- a/gbp/git/repository.py +++ b/gbp/git/repository.py @@ -1399,7 +1399,8 @@ class GitRepository(object): """ self._commit(msg=msg, args=['-a'], author_info=author_info, edit=edit) - def commit_files(self, files, msg, author_info=None, committer_info=None): + def commit_files(self, files, msg, author_info=None, committer_info=None, + edit=False): """ Commit the given files to the repository @@ -1411,11 +1412,13 @@ class GitRepository(object): @type author_info: L{GitModifier} @param committer_info: committer information @type committer_info: L{GitModifier} + @param edit: whether to spawn an editor to edit the commit info + @type edit: C{bool} """ - if isinstance(files, basestring): - files = [ files ] - self._commit(msg=msg, args=files, author_info=author_info, - committer_info=committer_info) + args = GitArgs('--') + args.add(files) + self._commit(msg=msg, args=args.args, author_info=author_info, + committer_info=committer_info, edit=edit) def create_tree(self, unpack_dir): """ -- cgit v1.2.3