From 75eb0d6eaa62b9d6708daf10ef3b12a0f5c0ecbd Mon Sep 17 00:00:00 2001 From: Markus Lehtonen Date: Wed, 5 Feb 2014 16:11:42 +0200 Subject: [PATCH] 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(-) diff --git a/gbp/git/repository.py b/gbp/git/repository.py index cc79e14..910c691 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): """ -- 2.7.4