From bc1011a585fdf376bde43edacd34eebca46e7d03 Mon Sep 17 00:00:00 2001 From: Markus Lehtonen Date: Tue, 17 Sep 2013 14:47:21 +0300 Subject: [PATCH] GitRepository.archive: add 'paths' option Signed-off-by: Markus Lehtonen --- gbp/git/repository.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gbp/git/repository.py b/gbp/git/repository.py index e03554d..29c7139 100644 --- a/gbp/git/repository.py +++ b/gbp/git/repository.py @@ -1706,7 +1706,7 @@ class GitRepository(object): return output #} - def archive(self, format, prefix, output, treeish): + def archive(self, format, prefix, output, treeish, paths=None): """ Create an archive from a treeish @@ -1719,6 +1719,8 @@ class GitRepository(object): @type output: C{str} or C{None} @param treeish: the treeish to create the archive from @type treeish: C{str} + @param paths: List of paths to include in the archive + @type paths: C{list} of C{str} @return: archive data as a generator object @rtype: C{None} or C{generator} of C{str} @@ -1726,6 +1728,8 @@ class GitRepository(object): args = GitArgs('--format=%s' % format, '--prefix=%s' % prefix) args.add_true(output, '--output=%s' % output) args.add(treeish) + args.add("--") + args.add_cond(paths, paths) if output: out, err, ret = self._git_inout('archive', args.args) -- 2.7.4