Skip to content

Commit 1ea8499

Browse files
committed
Make error a local variable.
1 parent f655dec commit 1ea8499

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

ObjectiveGitTests/GTBlobSpec.m

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,6 @@
1313
__block GTRepository *repository;
1414
__block NSString *blobSHA;
1515
__block GTBlob *blob;
16-
__block NSError *error;
17-
18-
beforeEach(^{
19-
error = nil;
20-
});
2116

2217
describe(@"blob properties can be accessed", ^{
2318
beforeEach(^{
@@ -51,6 +46,7 @@
5146

5247
describe(@"+blobWithString:inRepository:error", ^{
5348
it(@"works with valid parameters", ^{
49+
NSError *error = nil;
5450
blob = [GTBlob blobWithString:@"a new blob content" inRepository:repository error:&error];
5551
expect(error).to.beNil();
5652
expect(blob).notTo.beNil();
@@ -63,6 +59,7 @@
6359
char bytes[] = "100644 example_helper.rb\00\xD3\xD5\xED\x9D A4_\x00 40000 examples";
6460
NSData *content = [NSData dataWithBytes:bytes length:sizeof(bytes)];
6561

62+
NSError *error = nil;
6663
blob = [GTBlob blobWithData:content inRepository:repository error:&error];
6764
expect(error).to.beNil();
6865
expect(blob).notTo.beNil();
@@ -76,6 +73,7 @@
7673
NSString *fileName = @"myfile.txt";
7774
NSURL *fileURL = [repository.fileURL URLByAppendingPathComponent:fileName];
7875

76+
NSError *error = nil;
7977
BOOL success = [fileContent writeToURL:fileURL atomically:YES encoding:NSUTF8StringEncoding error:&error];
8078
expect(success).to.beTruthy();
8179
expect(error).to.beNil();

ObjectiveGitTests/GTCommitSpec.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,13 @@
1111
SpecBegin(GTCommit)
1212

1313
__block GTRepository *repository;
14-
__block NSError *error;
1514

1615
beforeEach(^{
1716
repository = self.bareFixtureRepository;
18-
error = nil;
1917
});
2018

2119
it(@"can read commit data", ^{
20+
NSError *error = nil;
2221
NSString *commitSHA = @"8496071c1b46c854b31185ea97743be6a8774479";
2322
GTCommit *commit = [repository lookupObjectBySHA:commitSHA error:&error];
2423

@@ -54,6 +53,7 @@
5453
});
5554

5655
it(@"canHaveMultipleParents", ^{
56+
NSError *error = nil;
5757
NSString *commitSHA = @"a4a7dce85cf63874e984719f4fdd239f5145052f";
5858
GTCommit *commit = [repository lookupObjectBySHA:commitSHA error:&error];
5959
expect(commit).notTo.beNil();

0 commit comments

Comments
 (0)