Commit d7ba101b authored by Jérome Perrin's avatar Jérome Perrin

gitclone: support git 2.38.1 when using submodules

See https://lore.kernel.org/lkml/xmqq4jw1uku5.fsf@gitster.g/

In the case of slapos, cloned repositories are considered trusted, so
it should not be an issue to set this flag.
parent 1e0c4423
Pipeline #24676 passed with stage
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
------------------ ------------------
- drop slapos.recipe.build:npm - drop slapos.recipe.build:npm
- gitclone: support git 2.38.1 when using submodules
0.55 (2022-06-07) 0.55 (2022-06-07)
----------------- -----------------
......
...@@ -184,8 +184,9 @@ class GitCloneNonInformativeTests(TestCase): ...@@ -184,8 +184,9 @@ class GitCloneNonInformativeTests(TestCase):
"Make sure parent repo and submodule repo are present") "Make sure parent repo and submodule repo are present")
submodule_dir_main_repo = os.path.join(self.project_dir, 'dir1') submodule_dir_main_repo = os.path.join(self.project_dir, 'dir1')
# Add submodule to main repo and commit # Add submodule to main repo and commit
check_call(['git', 'submodule', 'add', self.submodule_dir], check_call(
cwd=submodule_dir_main_repo) ['git', '-c', 'protocol.file.allow=always', 'submodule', 'add', self.submodule_dir],
cwd=submodule_dir_main_repo)
self.gitCommit(self.project_dir, msg='Add submodule repo') self.gitCommit(self.project_dir, msg='Add submodule repo')
def createRepositoriesAndConnect(self): def createRepositoriesAndConnect(self):
......
...@@ -196,6 +196,13 @@ class Recipe(object): ...@@ -196,6 +196,13 @@ class Recipe(object):
git_clone_command = [self.git_command, 'clone', git_clone_command = [self.git_command, 'clone',
self.repository, self.repository,
self.location] self.location]
if not self.ignore_cloning_submodules:
git_clone_command = [
self.git_command,
'-c', 'protocol.file.allow=always',
'clone',
self.repository,
self.location]
config = [] config = []
if self.shared: if self.shared:
git_clone_command.append('--shared') git_clone_command.append('--shared')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment