From a0e1635b6da8b7a69a6ebcb0e4bd4d1e8c611282 Mon Sep 17 00:00:00 2001 From: Rohit Goswami Date: Sat, 31 Dec 2022 01:18:43 +0530 Subject: [PATCH 1/2] TST: Fix error with submodules --- test/tools.py | 1 + 1 file changed, 1 insertion(+) diff --git a/test/tools.py b/test/tools.py index 54b54c0a5..6d8a36049 100644 --- a/test/tools.py +++ b/test/tools.py @@ -174,6 +174,7 @@ def init(self): self.run_git(['init']) self.run_git(['config', 'user.email', 'robot@asv']) self.run_git(['config', 'user.name', 'Robotic Swallow']) + self.run_git(['config', 'protocol.file.allow', 'always']) def commit(self, message, date=None): if date is None: From 759085790b5d31c71f7a2e1568ec52e41c25feab Mon Sep 17 00:00:00 2001 From: Rohit Goswami Date: Sun, 1 Jan 2023 15:28:32 +0530 Subject: [PATCH 2/2] TST: Be explicit with submodules --- asv/plugins/git.py | 4 ++-- test/test_repo.py | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/asv/plugins/git.py b/asv/plugins/git.py index 944b56093..3d77db871 100644 --- a/asv/plugins/git.py +++ b/asv/plugins/git.py @@ -87,13 +87,13 @@ def pull(self): def checkout(self, path, commit_hash): def checkout_existing(display_error): # Deinit fails if no submodules, so ignore its failure - self._run_git(['submodule', 'deinit', '-f', '.'], + self._run_git(['-c','protocol.file.allow=always', 'submodule', 'deinit', '-f', '.'], cwd=path, display_error=False, valid_return_codes=None) self._run_git(['checkout', '-f', commit_hash], cwd=path, display_error=display_error) self._run_git(['clean', '-fdx'], cwd=path, display_error=display_error) - self._run_git(['submodule', 'update', '--init', '--recursive'], + self._run_git(['-c','protocol.file.allow=always', 'submodule', 'update', '--init', '--recursive'], cwd=path, display_error=display_error) if os.path.isdir(path): diff --git a/test/test_repo.py b/test/test_repo.py index 109b45a19..9726a69c3 100644 --- a/test/test_repo.py +++ b/test/test_repo.py @@ -263,14 +263,14 @@ def test_git_submodule(tmpdir): commit_hash_0 = dvcs.get_hash("master") # State 1 (one submodule) - dvcs.run_git(['submodule', 'add', sub_dvcs.path, 'sub1']) + dvcs.run_git(['-c','protocol.file.allow=always', 'submodule', 'add', sub_dvcs.path, 'sub1']) dvcs.commit('Add sub1') commit_hash_1 = dvcs.get_hash("master") # State 2 (one submodule with sub-submodule) - dvcs.run_git(['submodule', 'update', '--init']) + dvcs.run_git(['-c','protocol.file.allow=always', 'submodule', 'update', '--init']) sub1_dvcs = tools.Git(join(dvcs.path, 'sub1')) - sub_dvcs.run_git(['submodule', 'add', ssub_dvcs.path, 'ssub1']) + sub_dvcs.run_git(['-c','protocol.file.allow=always', 'submodule', 'add', ssub_dvcs.path, 'ssub1']) sub_dvcs.commit('Add sub1') sub1_dvcs.run_git(['pull']) dvcs.run_git(['add', 'sub1'])