@@ -625,7 +625,7 @@ def clone_renku_repository(
625
625
install_githooks = False ,
626
626
install_lfs = True ,
627
627
skip_smudge = True ,
628
- recursive = True ,
628
+ recursive = False ,
629
629
progress = None ,
630
630
config : Optional [dict ] = None ,
631
631
raise_git_except = False ,
@@ -644,7 +644,7 @@ def clone_renku_repository(
644
644
install_githooks: Whether to install git hooks (Default value = False).
645
645
install_lfs: Whether to install Git LFS (Default value = True).
646
646
skip_smudge: Whether to pull files from Git LFS (Default value = True).
647
- recursive: Whether to clone recursively (Default value = True ).
647
+ recursive: Whether to clone recursively (Default value = False ).
648
648
progress: The GitProgress object (Default value = None).
649
649
config(Optional[dict], optional): Set configuration for the project (Default value = None).
650
650
raise_git_except: Whether to raise git exceptions (Default value = False).
@@ -710,7 +710,7 @@ def clone_repository(
710
710
install_githooks = True ,
711
711
install_lfs = True ,
712
712
skip_smudge = True ,
713
- recursive = True ,
713
+ recursive = False ,
714
714
depth = None ,
715
715
progress = None ,
716
716
config : Optional [dict ] = None ,
@@ -728,7 +728,7 @@ def clone_repository(
728
728
install_githooks: Whether to install git hooks (Default value = True).
729
729
install_lfs: Whether to install Git LFS (Default value = True).
730
730
skip_smudge: Whether to pull files from Git LFS (Default value = True).
731
- recursive: Whether to clone recursively (Default value = True ).
731
+ recursive: Whether to clone recursively (Default value = False ).
732
732
depth: The clone depth, number of commits from HEAD (Default value = None).
733
733
progress: The GitProgress object (Default value = None).
734
734
config(Optional[dict], optional): Set configuration for the project (Default value = None).
@@ -760,7 +760,7 @@ def handle_git_exception():
760
760
761
761
raise errors .GitError (message )
762
762
763
- def clean_directory ():
763
+ def clean_directory (clean : bool ):
764
764
if not clean or not path :
765
765
return
766
766
try :
@@ -791,10 +791,10 @@ def check_and_reuse_existing_repository() -> Optional["Repository"]:
791
791
pass
792
792
else :
793
793
# NOTE: not same remote, so don't reuse
794
- clean_directory ()
794
+ clean_directory (clean = clean )
795
795
return None
796
796
except errors .GitError : # NOTE: Not a git repository, remote not found, or checkout failed
797
- clean_directory ()
797
+ clean_directory (clean = clean )
798
798
else :
799
799
return repository
800
800
@@ -828,6 +828,9 @@ def clone(branch, depth):
828
828
handle_git_exception ()
829
829
raise
830
830
831
+ # NOTE: Delete the partially-cloned repository
832
+ clean_directory (clean = True )
833
+
831
834
# NOTE: clone without branch set, in case checkout_revision was not a branch or a tag but a commit
832
835
try :
833
836
repository = clone (branch = None , depth = None )
0 commit comments