|
381 | 381 | }); |
382 | 382 |
|
383 | 383 | describe(@"-checkout:strategy:notifyFlags:error:notifyBlock:progressBlock:", ^{ |
384 | | - it(@"should notify dirty file and stop ref checkout", ^{ |
| 384 | + it(@"should fail ref checkout with dirty file and notify", ^{ |
385 | 385 | NSError *error = nil; |
386 | 386 | GTReference *ref = [repository lookUpReferenceWithName:@"refs/heads/other-branch" error:&error]; |
387 | 387 | expect(ref).notTo(beNil()); |
388 | 388 | expect(error.localizedDescription).to(beNil()); |
389 | | - // Write something to a file in the repo |
390 | 389 | BOOL writeResult = [@"Replacement data in main.m\n" writeToURL:[repository.fileURL URLByAppendingPathComponent:mainFile] atomically:YES encoding:NSUTF8StringEncoding error:&error]; |
391 | 390 | expect(@(writeResult)).to(beTruthy()); |
392 | | - // Now attempt to checkout the other-branch |
393 | 391 | __block NSUInteger notifyCount = 0; |
394 | 392 | __block BOOL mainFileDirty = NO; |
395 | 393 | int (^notifyBlock)(GTCheckoutNotifyFlags, NSString *, GTDiffFile *, GTDiffFile *, GTDiffFile *); |
|
410 | 408 | expect(@(error.code)).to(equal(@(GIT_EUSER))); |
411 | 409 | }); |
412 | 410 |
|
413 | | - it(@"should notify dirty file and stop commit checkout", ^{ |
| 411 | + it(@"should fail commit checkout with dirty file and notify", ^{ |
414 | 412 | NSError *error = nil; |
415 | 413 | GTCommit *commit = [repository lookUpObjectBySHA:@"1d69f3c0aeaf0d62e25591987b93b8ffc53abd77" objectType:GTObjectTypeCommit error:&error]; |
416 | 414 | expect(commit).notTo(beNil()); |
417 | 415 | expect(error.localizedDescription).to(beNil()); |
418 | 416 | BOOL writeResult = [@"Replacement data in README\n" writeToURL:[repository.fileURL URLByAppendingPathComponent:readmeFile] atomically:YES encoding:NSUTF8StringEncoding error:&error]; |
419 | 417 | expect(@(writeResult)).to(beTruthy()); |
420 | | - // Now attempt to checkout the other-branch |
421 | 418 | __block NSUInteger notifyCount = 0; |
422 | 419 | __block BOOL readmeFileDirty = NO; |
423 | 420 | int (^notifyBlock)(GTCheckoutNotifyFlags, NSString *, GTDiffFile *, GTDiffFile *, GTDiffFile *); |
|
0 commit comments