diff options
author | Markus Lehtonen <markus.lehtonen@linux.intel.com> | 2013-09-17 14:47:21 +0300 |
---|---|---|
committer | Tzafrir Cohen <tzafrir@debian.org> | 2015-03-26 14:21:52 +0200 |
commit | 834a98b2edeeadca8a9c0526d5bb92239be8c1fb (patch) | |
tree | e1536c0890d9afb966bbed7053f7b0155a9e7939 | |
parent | 0bf0aa721be9a54d70898c0f00ba9c8d5446710f (diff) |
GitRepository.archive: add 'paths' option
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
-rw-r--r-- | gbp/git/repository.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/gbp/git/repository.py b/gbp/git/repository.py index 7d0cd32..90b14e1 100644 --- a/gbp/git/repository.py +++ b/gbp/git/repository.py @@ -1800,7 +1800,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 @@ -1813,6 +1813,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 @@ -1821,6 +1823,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) |