From 72693705bfcf18b161dcf005d9842db15959dc26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Bidoul?= Date: Wed, 21 Sep 2022 12:40:16 +0200 Subject: [PATCH 1/2] Use --filter=blob=none with sufficiently recent gits --- git_aggregator/repo.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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'}: From e1d1c7d02d2379f33faebd3224d772ae710b1ba7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Bidoul?= Date: Wed, 21 Sep 2022 12:42:09 +0200 Subject: [PATCH 2/2] Prepare 3.0.1 --- README.rst | 5 +++++ 1 file changed, 5 insertions(+) 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) ------------------