@@ -103,7 +103,7 @@ void test_submodule_update__update_submodule(void)
103103 cl_git_pass (git_submodule_lookup (& sm , g_repo , "testrepo" ));
104104
105105 /* verify the initial state of the submodule */
106- cl_git_pass (git_submodule_status (& submodule_status , sm ));
106+ cl_git_pass (git_submodule_status (& submodule_status , g_repo , "testrepo" ));
107107 cl_assert_equal_i (submodule_status , GIT_SUBMODULE_STATUS_IN_HEAD |
108108 GIT_SUBMODULE_STATUS_IN_INDEX |
109109 GIT_SUBMODULE_STATUS_IN_CONFIG |
@@ -114,7 +114,7 @@ void test_submodule_update__update_submodule(void)
114114 cl_git_pass (git_submodule_update (sm , 0 , & update_options ));
115115
116116 /* verify state */
117- cl_git_pass (git_submodule_status (& submodule_status , sm ));
117+ cl_git_pass (git_submodule_status (& submodule_status , g_repo , "testrepo" ));
118118 cl_assert_equal_i (submodule_status , GIT_SUBMODULE_STATUS_IN_HEAD |
119119 GIT_SUBMODULE_STATUS_IN_INDEX |
120120 GIT_SUBMODULE_STATUS_IN_CONFIG |
@@ -142,7 +142,7 @@ void test_submodule_update__update_and_init_submodule(void)
142142 /* get the submodule */
143143 cl_git_pass (git_submodule_lookup (& sm , g_repo , "testrepo" ));
144144
145- cl_git_pass (git_submodule_status (& submodule_status , sm ));
145+ cl_git_pass (git_submodule_status (& submodule_status , g_repo , "testrepo" ));
146146 cl_assert_equal_i (submodule_status , GIT_SUBMODULE_STATUS_IN_HEAD |
147147 GIT_SUBMODULE_STATUS_IN_INDEX |
148148 GIT_SUBMODULE_STATUS_IN_CONFIG |
@@ -177,7 +177,7 @@ void test_submodule_update__update_already_checked_out_submodule(void)
177177 /* Initialize and update the sub repository */
178178 cl_git_pass (git_submodule_lookup (& sm , g_repo , "testrepo" ));
179179
180- cl_git_pass (git_submodule_status (& submodule_status , sm ));
180+ cl_git_pass (git_submodule_status (& submodule_status , g_repo , "testrepo" ));
181181 cl_assert_equal_i (submodule_status , GIT_SUBMODULE_STATUS_IN_HEAD |
182182 GIT_SUBMODULE_STATUS_IN_INDEX |
183183 GIT_SUBMODULE_STATUS_IN_CONFIG |
@@ -203,7 +203,11 @@ void test_submodule_update__update_already_checked_out_submodule(void)
203203 * HEAD commit and index should be updated, but not the workdir.
204204 */
205205
206- cl_git_pass (git_submodule_status (& submodule_status , sm ));
206+ cl_git_pass (git_submodule_status (& submodule_status , g_repo , "testrepo" ));
207+
208+ git_submodule_free (sm );
209+ cl_git_pass (git_submodule_lookup (& sm , g_repo , "testrepo" ));
210+
207211 cl_assert_equal_i (submodule_status , GIT_SUBMODULE_STATUS_IN_HEAD |
208212 GIT_SUBMODULE_STATUS_IN_INDEX |
209213 GIT_SUBMODULE_STATUS_IN_CONFIG |
@@ -251,7 +255,7 @@ void test_submodule_update__update_blocks_on_dirty_wd(void)
251255 /* Initialize and update the sub repository */
252256 cl_git_pass (git_submodule_lookup (& sm , g_repo , "testrepo" ));
253257
254- cl_git_pass (git_submodule_status (& submodule_status , sm ));
258+ cl_git_pass (git_submodule_status (& submodule_status , g_repo , "testrepo" ));
255259 cl_assert_equal_i (submodule_status , GIT_SUBMODULE_STATUS_IN_HEAD |
256260 GIT_SUBMODULE_STATUS_IN_INDEX |
257261 GIT_SUBMODULE_STATUS_IN_CONFIG |
@@ -277,7 +281,11 @@ void test_submodule_update__update_blocks_on_dirty_wd(void)
277281 * HEAD commit and index should be updated, but not the workdir.
278282 */
279283
280- cl_git_pass (git_submodule_status (& submodule_status , sm ));
284+ cl_git_pass (git_submodule_status (& submodule_status , g_repo , "testrepo" ));
285+
286+ git_submodule_free (sm );
287+ cl_git_pass (git_submodule_lookup (& sm , g_repo , "testrepo" ));
288+
281289 cl_assert_equal_i (submodule_status , GIT_SUBMODULE_STATUS_IN_HEAD |
282290 GIT_SUBMODULE_STATUS_IN_INDEX |
283291 GIT_SUBMODULE_STATUS_IN_CONFIG |
@@ -324,7 +332,7 @@ void test_submodule_update__can_force_update(void)
324332 /* Initialize and update the sub repository */
325333 cl_git_pass (git_submodule_lookup (& sm , g_repo , "testrepo" ));
326334
327- cl_git_pass (git_submodule_status (& submodule_status , sm ));
335+ cl_git_pass (git_submodule_status (& submodule_status , g_repo , "testrepo" ));
328336 cl_assert_equal_i (submodule_status , GIT_SUBMODULE_STATUS_IN_HEAD |
329337 GIT_SUBMODULE_STATUS_IN_INDEX |
330338 GIT_SUBMODULE_STATUS_IN_CONFIG |
@@ -349,7 +357,11 @@ void test_submodule_update__can_force_update(void)
349357 * Verify state after checkout of parent repository. The submodule ID in the
350358 * HEAD commit and index should be updated, but not the workdir.
351359 */
352- cl_git_pass (git_submodule_status (& submodule_status , sm ));
360+ cl_git_pass (git_submodule_status (& submodule_status , g_repo , "testrepo" ));
361+
362+ git_submodule_free (sm );
363+ cl_git_pass (git_submodule_lookup (& sm , g_repo , "testrepo" ));
364+
353365 cl_assert_equal_i (submodule_status , GIT_SUBMODULE_STATUS_IN_HEAD |
354366 GIT_SUBMODULE_STATUS_IN_INDEX |
355367 GIT_SUBMODULE_STATUS_IN_CONFIG |
0 commit comments