| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -5,6 +5,7 @@ Changelog | |||
| 5 | 5 | 0.3.6 - Features | |
| 6 | 6 | ================ | |
| 7 | 7 | * Added `Repo.merge_base()` implementation. See the `respective issue on github <https://github.com/gitpython-developers/GitPython/issues/169>`_ | |
| 8 | + * `[include]` sections in git configuration files are now respected | ||
| 8 | 9 | * A list of all issues can be found here: https://github.com/gitpython-developers/GitPython/issues?q=milestone%3A%22v0.3.6+-+Features%22+ | |
| 9 | 10 | ||
| 10 | 11 | 0.3.5 - Bugfixes | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -846,7 +846,10 @@ def archive(self, ostream, treeish=None, prefix=None, **kwargs): | |||
| 846 | 846 | :parm kwargs: | |
| 847 | 847 | Additional arguments passed to git-archive | |
| 848 | 848 | NOTE: Use the 'format' argument to define the kind of format. Use | |
| 849 | - specialized ostreams to write any format supported by python | ||
| 849 | + specialized ostreams to write any format supported by python. | ||
| 850 | + | ||
| 851 | + You may specify the special 'path' keyword, which may either be a repository-relative | ||
| 852 | + path to a directory or file to place into the archive, or a list or tuple of multipe paths. | ||
| 850 | 853 | ||
| 851 | 854 | :raise GitCommandError: in case something went wrong | |
| 852 | 855 | :return: self""" | |
@@ -855,8 +858,12 @@ def archive(self, ostream, treeish=None, prefix=None, **kwargs): | |||
| 855 | 858 | if prefix and 'prefix' not in kwargs: | |
| 856 | 859 | kwargs['prefix'] = prefix | |
| 857 | 860 | kwargs['output_stream'] = ostream | |
| 861 | + path = kwargs.pop('path', list()) | ||
| 862 | + if not isinstance(path, (tuple, list)): | ||
| 863 | + path = [path] | ||
| 864 | + # end assure paths is list | ||
| 858 | 865 | ||
| 859 | - self.git.archive(treeish, **kwargs) | ||
| 866 | + self.git.archive(treeish, *path, **kwargs) | ||
| 860 | 867 | return self | |
| 861 | 868 | ||
| 862 | 869 | rev_parse = rev_parse | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -266,7 +266,7 @@ def test_tag(self): | |||
| 266 | 266 | def test_archive(self): | |
| 267 | 267 | tmpfile = tempfile.mktemp(suffix='archive-test') | |
| 268 | 268 | stream = open(tmpfile, 'wb') | |
| 269 | - self.rorepo.archive(stream, '0.1.5') | ||
| 269 | + self.rorepo.archive(stream, '0.1.6', path='doc') | ||
| 270 | 270 | assert stream.tell() | |
| 271 | 271 | stream.close() | |
| 272 | 272 | os.remove(tmpfile) | |
| Back | FazBrowse Home | New Git URL |
0 commit comments