@@ -353,44 +353,19 @@ void test_clone_nonetwork__clone_from_empty_sets_upstream(void)
353
353
cl_fixture_cleanup ("./repowithunborn" );
354
354
}
355
355
356
- static int just_return_origin (git_remote * * out , git_repository * repo , const char * name , const char * url , void * payload )
357
- {
358
- GIT_UNUSED (url ); GIT_UNUSED (payload );
359
-
360
- return git_remote_lookup (out , repo , name );
361
- }
362
-
363
- static int just_return_repo (git_repository * * out , const char * path , int bare , void * payload )
364
- {
365
- git_submodule * sm = payload ;
366
-
367
- GIT_UNUSED (path ); GIT_UNUSED (bare );
368
-
369
- return git_submodule_open (out , sm );
370
- }
371
-
372
356
void test_clone_nonetwork__clone_submodule (void )
373
357
{
374
- git_clone_options clone_opts = GIT_CLONE_OPTIONS_INIT ;
375
358
git_index * index ;
376
359
git_oid tree_id , commit_id ;
377
360
git_submodule * sm ;
378
361
git_signature * sig ;
379
- git_repository * sm_repo ;
380
362
381
363
cl_git_pass (git_repository_init (& g_repo , "willaddsubmodule" , false));
382
364
383
-
384
365
/* Create the submodule structure, clone into it and finalize */
385
366
cl_git_pass (git_submodule_add_setup (& sm , g_repo , cl_fixture ("testrepo.git" ), "testrepo" , true));
386
-
387
- clone_opts .repository_cb = just_return_repo ;
388
- clone_opts .repository_cb_payload = sm ;
389
- clone_opts .remote_cb = just_return_origin ;
390
- clone_opts .remote_cb_payload = sm ;
391
- cl_git_pass (git_clone (& sm_repo , cl_fixture ("testrepo.git" ), "testrepo" , & clone_opts ));
367
+ cl_git_pass (git_submodule_add_clone (NULL , sm ));
392
368
cl_git_pass (git_submodule_add_finalize (sm ));
393
- git_repository_free (sm_repo );
394
369
git_submodule_free (sm );
395
370
396
371
cl_git_pass (git_repository_index (& index , g_repo ));
0 commit comments