summaryrefslogtreecommitdiff
path: root/gbp/git/repository.py
diff options
context:
space:
mode:
authorMarkus Lehtonen <markus.lehtonen@linux.intel.com>2014-02-05 16:11:42 +0200
committerMarkus Lehtonen <markus.lehtonen@linux.intel.com>2014-06-05 14:20:03 +0300
commitedd12bc8d2bba682ebbae807dfcb428b2d6f4c4e (patch)
tree208a216961593328a8d7976cb4627f3380f16c41 /gbp/git/repository.py
parentf3b923c486d20a8cb70c63e23c87fa67537b2245 (diff)
downloadgit-buildpackage-edd12bc8d2bba682ebbae807dfcb428b2d6f4c4e.tar.gz
git-buildpackage-edd12bc8d2bba682ebbae807dfcb428b2d6f4c4e.tar.bz2
git-buildpackage-edd12bc8d2bba682ebbae807dfcb428b2d6f4c4e.zip
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 <markus.lehtonen@linux.intel.com>
Diffstat (limited to 'gbp/git/repository.py')
-rw-r--r--gbp/git/repository.py13
1 files changed, 8 insertions, 5 deletions
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):
"""