Skip to content

Commit 2a462f2

Browse files
authored
Merge pull request #67 from acsone/git-217
Use --filter=blob=none with sufficiently recent gits
2 parents 0f7003f + e1d1c7d commit 2a462f2

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

README.rst

+5
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,11 @@ To work around API limitation, you must first generate a
221221
Changes
222222
=======
223223

224+
3.0.1 (2022-09-21)
225+
------------------
226+
227+
* Fix git clone issue with git < 2.17
228+
224229
3.0.0 (2022-09-20)
225230
------------------
226231

git_aggregator/repo.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,13 @@ def init_repository(self, target_dir):
221221
repository,
222222
target_dir,
223223
)
224-
cmd = ('git', 'clone', '--filter=blob:none')
224+
cmd = ('git', 'clone')
225+
if self.git_version >= (2, 17):
226+
# Git added support for partial clone in 2.17
227+
# https://git-scm.com/docs/partial-clone
228+
# Speeds up cloning by functioning without a complete copy of
229+
# repository
230+
cmd += ('--filter=blob:none',)
225231
# Try to clone target branch, if it exists
226232
rtype, _sha = self.query_remote_ref(repository, branch)
227233
if rtype in {'branch', 'tag'}:

0 commit comments

Comments
 (0)