Merge pull request !2737 from rhodecode-enterprise-ce RCCE-194-partial-clone

feat(git): added necesary git config options to enable partial and shallow cloning via ssh by default
This commit is contained in:
Andrii Verbytskyi 2025-05-12 10:33:04 +00:00
commit a8ec20b857

View file

@ -39,7 +39,11 @@ class GitTunnelWrapper(object):
def command(self):
root = self.server.get_root_store()
git_server_config = " "
# Support for partial and shallow cloning
if self.server.repo_mode == "upload-pack":
git_server_config = " -c uploadpack.allowfilter=true -c uploadpack.allowAnySHA1InWant=true "
else:
git_server_config = " "
command = f"cd {root}; {self.server.git_path}{git_server_config}{self.server.repo_mode} '{root}{self.server.repo_name}'"
log.debug("Final CMD: %s", command)
return command