Skip to content

Commit

Permalink
Merge pull request acsone#67 from acsone/git-217
Browse files Browse the repository at this point in the history
Use --filter=blob=none with sufficiently recent gits
  • Loading branch information
sbidoul authored Sep 21, 2022
2 parents 0f7003f + e1d1c7d commit 2a462f2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
5 changes: 5 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,11 @@ To work around API limitation, you must first generate a
Changes
=======

3.0.1 (2022-09-21)
------------------

* Fix git clone issue with git < 2.17

3.0.0 (2022-09-20)
------------------

Expand Down
8 changes: 7 additions & 1 deletion git_aggregator/repo.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,13 @@ def init_repository(self, target_dir):
repository,
target_dir,
)
cmd = ('git', 'clone', '--filter=blob:none')
cmd = ('git', 'clone')
if self.git_version >= (2, 17):
# Git added support for partial clone in 2.17
# https://git-scm.com/docs/partial-clone
# Speeds up cloning by functioning without a complete copy of
# repository
cmd += ('--filter=blob:none',)
# Try to clone target branch, if it exists
rtype, _sha = self.query_remote_ref(repository, branch)
if rtype in {'branch', 'tag'}:
Expand Down

0 comments on commit 2a462f2

Please sign in to comment.