diff --git a/README.rst b/README.rst index 6db8648..033b83c 100644 --- a/README.rst +++ b/README.rst @@ -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) ------------------ diff --git a/git_aggregator/repo.py b/git_aggregator/repo.py index 27ed24f..151a24a 100644 --- a/git_aggregator/repo.py +++ b/git_aggregator/repo.py @@ -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'}: