|
67 | 67 | expect(submodule).notTo(beNil()); |
68 | 68 | expect(@(git_submodule_url(submodule.git_submodule))).notTo(equal(testURLString)); |
69 | 69 |
|
70 | | - git_submodule_set_url(submodule.git_submodule, testURLString.UTF8String); |
71 | | - git_submodule_save(submodule.git_submodule); |
| 70 | + git_submodule_set_url(repo.git_repository, git_submodule_name(submodule.git_submodule), testURLString.UTF8String); |
72 | 71 |
|
73 | 72 | __block NSError *error = nil; |
74 | 73 | expect(@([submodule writeToParentConfigurationDestructively:YES error:&error])).to(beTruthy()); |
|
79 | 78 | expect(@(git_submodule_url(submodule.git_submodule))).to(equal(testURLString)); |
80 | 79 | }); |
81 | 80 |
|
82 | | -it(@"should reload all submodules", ^{ |
83 | | - GTSubmodule *submodule = [repo submoduleWithName:@"new_submodule" error:NULL]; |
84 | | - expect(submodule).to(beNil()); |
85 | | - |
86 | | - NSURL *gitmodulesURL = [repo.fileURL URLByAppendingPathComponent:@".gitmodules"]; |
87 | | - NSMutableString *gitmodules = [NSMutableString stringWithContentsOfURL:gitmodulesURL usedEncoding:NULL error:NULL]; |
88 | | - expect(gitmodules).notTo(beNil()); |
89 | | - |
90 | | - [gitmodules appendString:@"[submodule \"new_submodule\"]\n\turl = some_url\n\tpath = new_submodule_path"]; |
91 | | - expect(@([gitmodules writeToURL:gitmodulesURL atomically:YES encoding:NSUTF8StringEncoding error:NULL])).to(beTruthy()); |
92 | | - |
93 | | - __block NSError *error = nil; |
94 | | - expect(@([repo reloadSubmodules:&error])).to(beTruthy()); |
95 | | - expect(error).to(beNil()); |
96 | | - |
97 | | - submodule = [repo submoduleWithName:@"new_submodule" error:NULL]; |
98 | | - expect(submodule).notTo(beNil()); |
99 | | - expect(submodule.path).to(equal(@"new_submodule_path")); |
100 | | -}); |
101 | | - |
102 | 81 | it(@"should add its HEAD to its parent's index", ^{ |
103 | 82 | GTSubmodule *submodule = [repo submoduleWithName:@"Test_App" error:NULL]; |
104 | 83 | expect(submodule).notTo(beNil()); |
|
0 commit comments