|
53 | 53 | it(@"should write to a specific repository and return a tree", ^{
|
54 | 54 | GTRepository *repository = self.bareFixtureRepository;
|
55 | 55 | NSArray *branches = [repository branches:NULL];
|
56 |
| - GTCommit *masterCommit = [branches[0] targetCommitAndReturnError:NULL]; |
57 |
| - GTCommit *packedCommit = [branches[1] targetCommitAndReturnError:NULL]; |
| 56 | + GTCommit *masterCommit = [branches[0] targetCommitWithError:NULL]; |
| 57 | + GTCommit *packedCommit = [branches[1] targetCommitWithError:NULL]; |
58 | 58 |
|
59 | 59 | expect(masterCommit).notTo(beNil());
|
60 | 60 | expect(packedCommit).notTo(beNil());
|
|
92 | 92 | if (treeEntry.type == GTObjectTypeBlob) {
|
93 | 93 | NSString *path = [root stringByAppendingString:treeEntry.name];
|
94 | 94 |
|
95 |
| - GTIndexEntry *indexEntry = [memoryIndex entryWithName:path]; |
| 95 | + GTIndexEntry *indexEntry = [memoryIndex entryWithPath:path]; |
96 | 96 | expect(indexEntry).notTo(beNil());
|
97 | 97 | }
|
98 | 98 |
|
|
229 | 229 |
|
230 | 230 | it(@"it preserves decomposed Unicode in index paths with precomposeunicode disabled", ^{
|
231 | 231 | NSString *decomposedFilename = [filename decomposedStringWithCanonicalMapping];
|
232 |
| - GTIndexEntry *entry = [index entryWithName:decomposedFilename error:NULL]; |
| 232 | + GTIndexEntry *entry = [index entryWithPath:decomposedFilename error:NULL]; |
233 | 233 | expect(@(fileStatusEqualsExpected(entry.path, GTStatusDeltaStatusUnmodified, GTStatusDeltaStatusUnmodified))).to(beTruthy());
|
234 | 234 |
|
235 | 235 | expect(@([[NSFileManager defaultManager] moveItemAtURL:fileURL toURL:renamedFileURL error:NULL])).to(beTruthy());
|
236 | 236 |
|
237 |
| - entry = [index entryWithName:decomposedFilename error:NULL]; |
| 237 | + entry = [index entryWithPath:decomposedFilename error:NULL]; |
238 | 238 | expect(@(fileStatusEqualsExpected(entry.path, GTStatusDeltaStatusUnmodified, GTStatusDeltaStatusDeleted))).to(beTruthy());
|
239 | 239 |
|
240 | 240 | [index removeFile:filename error:NULL];
|
241 | 241 | [index addFile:renamedFilename error:NULL];
|
242 | 242 | [index write:NULL];
|
243 | 243 |
|
244 |
| - entry = [index entryWithName:[renamedFilename decomposedStringWithCanonicalMapping] error:NULL]; |
| 244 | + entry = [index entryWithPath:[renamedFilename decomposedStringWithCanonicalMapping] error:NULL]; |
245 | 245 | expect(@(fileStatusEqualsExpected(entry.path, GTStatusDeltaStatusRenamed, GTStatusDeltaStatusUnmodified))).to(beTruthy());
|
246 | 246 | });
|
247 | 247 |
|
248 | 248 | it(@"it preserves precomposed Unicode in index paths with precomposeunicode enabled", ^{
|
249 |
| - GTIndexEntry *fileEntry = [index entryWithName:[filename decomposedStringWithCanonicalMapping] error:NULL]; |
| 249 | + GTIndexEntry *fileEntry = [index entryWithPath:[filename decomposedStringWithCanonicalMapping] error:NULL]; |
250 | 250 | expect(fileEntry).notTo(beNil());
|
251 | 251 | expect(@(fileStatusEqualsExpected(fileEntry.path, GTStatusDeltaStatusUnmodified, GTStatusDeltaStatusUnmodified))).to(beTruthy());
|
252 | 252 |
|
253 | 253 | [configuration setBool:true forKey:@"core.precomposeunicode"];
|
254 | 254 | expect(@([configuration boolForKey:@"core.precomposeunicode"])).to(beTruthy());
|
255 | 255 |
|
256 |
| - GTIndexEntry *decomposedFileEntry = [index entryWithName:[filename decomposedStringWithCanonicalMapping] error:NULL]; |
| 256 | + GTIndexEntry *decomposedFileEntry = [index entryWithPath:[filename decomposedStringWithCanonicalMapping] error:NULL]; |
257 | 257 | expect(decomposedFileEntry).notTo(beNil());
|
258 | 258 | expect(@(fileStatusEqualsExpected(decomposedFileEntry.path, GTStatusDeltaStatusUnmodified, GTStatusDeltaStatusDeleted))).to(beTruthy());
|
259 | 259 |
|
260 | 260 | expect(@([[NSFileManager defaultManager] moveItemAtURL:fileURL toURL:renamedFileURL error:NULL])).to(beTruthy());
|
261 | 261 |
|
262 |
| - GTIndexEntry *precomposedFileEntry = [index entryWithName:filename error:NULL]; |
| 262 | + GTIndexEntry *precomposedFileEntry = [index entryWithPath:filename error:NULL]; |
263 | 263 | expect(precomposedFileEntry).to(beNil());
|
264 | 264 |
|
265 |
| - decomposedFileEntry = [index entryWithName:[filename decomposedStringWithCanonicalMapping] error:NULL]; |
| 265 | + decomposedFileEntry = [index entryWithPath:[filename decomposedStringWithCanonicalMapping] error:NULL]; |
266 | 266 | expect(decomposedFileEntry).notTo(beNil());
|
267 | 267 | expect(@(fileStatusEqualsExpected(decomposedFileEntry.path, GTStatusDeltaStatusUnmodified, GTStatusDeltaStatusDeleted))).to(beTruthy());
|
268 | 268 |
|
269 | 269 | [index removeFile:filename error:NULL];
|
270 | 270 | [index addFile:renamedFilename error:NULL];
|
271 | 271 | [index write:NULL];
|
272 | 272 |
|
273 |
| - GTIndexEntry *precomposedRenamedFileEntry = [index entryWithName:renamedFilename error:NULL]; |
| 273 | + GTIndexEntry *precomposedRenamedFileEntry = [index entryWithPath:renamedFilename error:NULL]; |
274 | 274 | expect(precomposedRenamedFileEntry).notTo(beNil());
|
275 | 275 | expect(@(fileStatusEqualsExpected(precomposedFileEntry.path, GTStatusDeltaStatusRenamed, GTStatusDeltaStatusUntracked))).to(beTruthy());
|
276 | 276 | });
|
|
292 | 292 |
|
293 | 293 | it(@"should store data at given path", ^{
|
294 | 294 | NSData *data = [NSData dataWithBytes:"foo" length:4];
|
295 |
| - [index addData:data withName:@"bar/foo" error:&error]; |
| 295 | + [index addData:data withPath:@"bar/foo" error:&error]; |
296 | 296 | expect(error).to(beNil());
|
297 | 297 |
|
298 |
| - GTIndexEntry *entry = [index entryWithName:@"bar/foo" error:&error]; |
| 298 | + GTIndexEntry *entry = [index entryWithPath:@"bar/foo" error:&error]; |
299 | 299 | expect(entry).notTo(beNil());
|
300 | 300 | expect(error).to(beNil());
|
301 | 301 | });
|
|
0 commit comments