summaryrefslogtreecommitdiff
path: root/gbp
diff options
context:
space:
mode:
authorMarkus Lehtonen <markus.lehtonen@linux.intel.com>2013-09-17 14:47:21 +0300
committerMarkus Lehtonen <markus.lehtonen@linux.intel.com>2014-12-16 09:55:14 +0200
commitdb106213a7d1b6ddc34388a8b4cce82534b9afd3 (patch)
tree3da46ff4380725201615b0bda887e4fbecddf9af /gbp
parent099a83843f4c4d3436668dd69a3d59a1f2983a1f (diff)
GitRepository.archive: add 'paths' option
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Diffstat (limited to 'gbp')
-rw-r--r--gbp/git/repository.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/gbp/git/repository.py b/gbp/git/repository.py
index 2919b57..04a8aaf 100644
--- a/gbp/git/repository.py
+++ b/gbp/git/repository.py
@@ -1799,7 +1799,7 @@ class GitRepository(object):
return result
#}
- def archive(self, format, prefix, output, treeish, **kwargs):
+ def archive(self, format, prefix, output, treeish, paths=None, **kwargs):
"""
Create an archive from a treeish
@@ -1812,6 +1812,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}
@param kwargs: additional commandline options passed to git-archive
@return: archive data as a generator object
@@ -1820,6 +1822,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, **kwargs)