@@ -121,7 +121,7 @@ def repo_with_content(git_repo):
121
121
yield git_repo , sha1
122
122
123
123
124
- @pytest .fixture ()
124
+ @pytest .fixture
125
125
def repo_with_submodule ():
126
126
"""Create a git repository with a git submodule in a non-master branch.
127
127
@@ -134,15 +134,13 @@ def repo_with_submodule():
134
134
the submodule yet.
135
135
136
136
"""
137
- with TemporaryDirectory () as git_a_dir , TemporaryDirectory () as git_b_dir :
137
+ submodule_repo = "https://github.com/binderhub-ci-repos/requirements"
138
+ submod_sha1_b = "20c4fe55a9b2c5011d228545e821b1c7b1723652"
139
+
140
+ with TemporaryDirectory () as git_a_dir :
138
141
# create "parent" repository
139
142
subprocess .check_call (["git" , "init" ], cwd = git_a_dir )
140
143
_add_content_to_git (git_a_dir )
141
- # create repository with 2 commits that will be the submodule
142
- subprocess .check_call (["git" , "init" ], cwd = git_b_dir )
143
- _add_content_to_git (git_b_dir )
144
- submod_sha1_b = _get_sha1 (git_b_dir )
145
- _add_content_to_git (git_b_dir )
146
144
147
145
# create a new branch in the parent without any submodule
148
146
subprocess .check_call (
@@ -153,7 +151,14 @@ def repo_with_submodule():
153
151
["git" , "checkout" , "-b" , "branch-with-submod" ], cwd = git_a_dir
154
152
)
155
153
subprocess .check_call (
156
- ["git" , "submodule" , "add" , git_b_dir , "submod" ], cwd = git_a_dir
154
+ [
155
+ "git" ,
156
+ "submodule" ,
157
+ "add" ,
158
+ submodule_repo ,
159
+ "submod" ,
160
+ ],
161
+ cwd = git_a_dir ,
157
162
)
158
163
# checkout the first commit for the submod, not the latest
159
164
subprocess .check_call (
0 commit comments