|
65 | 65 | }); |
66 | 66 |
|
67 | 67 | afterEach(^{ |
68 | | - [NSFileManager.defaultManager removeItemAtURL:remoteRepoURL error:&error]; |
69 | | - expect(error).to(beNil()); |
70 | | - [NSFileManager.defaultManager removeItemAtURL:localRepoURL error:&error]; |
71 | | - expect(error).to(beNil()); |
| 68 | + [NSFileManager.defaultManager removeItemAtURL:remoteRepoURL error:NULL]; |
| 69 | + [NSFileManager.defaultManager removeItemAtURL:localRepoURL error:NULL]; |
72 | 70 | error = NULL; |
73 | 71 | [self tearDown]; |
74 | 72 | }); |
|
221 | 219 |
|
222 | 220 | // Pull |
223 | 221 | __block BOOL transferProgressed = NO; |
224 | | - // FIXME: This is analyzing merge as "up-to-date" |
225 | 222 | BOOL result = [localRepo pullBranch:masterBranch fromRemote:remote withOptions:nil error:&error progress:^(const git_transfer_progress *progress, BOOL *stop) { |
226 | 223 | transferProgressed = YES; |
227 | 224 | }]; |
228 | 225 | expect(@(result)).to(beTruthy()); |
229 | 226 | expect(error).to(beNil()); |
230 | | - expect(@(transferProgressed)).to(beTruthy()); // TODO: This one works? |
| 227 | + expect(@(transferProgressed)).to(beTruthy()); |
231 | 228 |
|
232 | 229 | // Validate |
233 | 230 |
|
|
242 | 239 | expect(@(uniqueLocalCommits.count)).to(equal(@3)); |
243 | 240 | }); |
244 | 241 |
|
| 242 | + /// Conflict During Merge |
| 243 | + it(@"erupts in a ball of 🔥 with a merge conflict ", ^{ |
| 244 | + // Stage a conflict by adding the same file with different contents to both repos |
| 245 | + GTCommit *localCommit = createCommitInRepository(@"Local commit", [@"TestLocal" dataUsingEncoding:NSUTF8StringEncoding], @"test.txt", localRepo); |
| 246 | + expect(localCommit).notTo(beNil()); |
| 247 | + GTCommit *remoteCommit = createCommitInRepository(@"Upstream commit", [@"TestUpstream" dataUsingEncoding:NSUTF8StringEncoding], @"test.txt", remoteRepo); |
| 248 | + expect(remoteCommit).notTo(beNil()); |
| 249 | + |
| 250 | + GTBranch *masterBranch = localBranchWithName(@"master", localRepo); |
| 251 | + |
| 252 | + // Pull |
| 253 | + __block BOOL transferProgressed = NO; |
| 254 | + BOOL result = [localRepo pullBranch:masterBranch fromRemote:remote withOptions:nil error:&error progress:^(const git_transfer_progress *progress, BOOL *stop) { |
| 255 | + transferProgressed = YES; |
| 256 | + }]; |
| 257 | + expect(@(result)).to(beFalsy()); |
| 258 | + expect(error).toNot(beNil()); |
| 259 | + expect(@(transferProgressed)).to(beTruthy()); |
| 260 | + }); |
| 261 | + |
245 | 262 | }); |
246 | 263 |
|
247 | 264 | }); |
|
0 commit comments