Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions ObjectiveGitFramework.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1881,6 +1881,7 @@
PRODUCT_BUNDLE_IDENTIFIER = "org.libgit2.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
VALID_ARCHS = "x86_64 arm64";
};
name = Debug;
};
Expand All @@ -1902,6 +1903,7 @@
PRODUCT_BUNDLE_IDENTIFIER = "org.libgit2.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
VALID_ARCHS = "x86_64 arm64";
};
name = Release;
};
Expand Down Expand Up @@ -1988,6 +1990,7 @@
PRODUCT_BUNDLE_IDENTIFIER = "org.libgit2.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
VALID_ARCHS = "x86_64 arm64";
};
name = Test;
};
Expand Down Expand Up @@ -2206,6 +2209,7 @@
PRODUCT_BUNDLE_IDENTIFIER = "org.libgit2.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
VALID_ARCHS = "x86_64 arm64";
};
name = Profile;
};
Expand Down
10 changes: 5 additions & 5 deletions ObjectiveGitTests/GTBlameSpec.m
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
__block GTBlame *blame = nil;

beforeEach(^{
blame = [self.testAppFixtureRepository blameWithFile:@"README1.txt" options:nil error:nil];
blame = [QuickSpec.current.testAppFixtureRepository blameWithFile:@"README1.txt" options:nil error:nil];
expect(blame).notTo(beNil());
});

Expand Down Expand Up @@ -59,23 +59,23 @@

describe(@"Creating a blame with options", ^{
it(@"should follow the instructions provided by the GTBlameOptionsOldestCommitOID key", ^{
GTBlame *optionsBlame = [self.testAppFixtureRepository blameWithFile:@"README1.txt" options:@{ GTBlameOptionsOldestCommitOID: [GTOID oidWithSHA:@"1d69f3c0aeaf0d62e25591987b93b8ffc53abd77"] } error:nil];
GTBlame *optionsBlame = [QuickSpec.current.testAppFixtureRepository blameWithFile:@"README1.txt" options:@{ GTBlameOptionsOldestCommitOID: [GTOID oidWithSHA:@"1d69f3c0aeaf0d62e25591987b93b8ffc53abd77"] } error:nil];

expect(optionsBlame).notTo(beNil());
expect(optionsBlame).notTo(equal(blame));
});

it(@"should follow the instructions provided by the GTBlameOptionsNewestCommitOID key", ^{
GTOID *newOID = [GTOID oidWithSHA:@"6317779b4731d9c837dcc6972b964bdf4211eeef"];
GTBlame *optionsBlame = [self.testAppFixtureRepository blameWithFile:@"README1.txt" options:@{ GTBlameOptionsNewestCommitOID: newOID } error:nil];
GTBlame *optionsBlame = [QuickSpec.current.testAppFixtureRepository blameWithFile:@"README1.txt" options:@{ GTBlameOptionsNewestCommitOID: newOID } error:nil];

GTBlameHunk *hunk = [optionsBlame hunkAtIndex:0];
expect(@(hunk.lines.location)).to(equal(@1));
expect(@(hunk.lines.length)).to(equal(@25));
});

it(@"should follow the instructions provided by GTBlameOptionsFirstLine and GTBlameOptionsLastLine keys", ^{
GTBlame *optionsBlame = [self.testAppFixtureRepository blameWithFile:@"README1.txt" options:@{ GTBlameOptionsFirstLine: @22, GTBlameOptionsLastLine: @24 } error:nil];
GTBlame *optionsBlame = [QuickSpec.current.testAppFixtureRepository blameWithFile:@"README1.txt" options:@{ GTBlameOptionsFirstLine: @22, GTBlameOptionsLastLine: @24 } error:nil];
GTBlameHunk *hunk = [optionsBlame hunkAtIndex:0];

expect(optionsBlame).notTo(beNil());
Expand All @@ -85,7 +85,7 @@
});

afterEach(^{
[self tearDown];
[QuickSpec.current tearDown];
});

QuickSpecEnd
6 changes: 3 additions & 3 deletions ObjectiveGitTests/GTBlobSpec.m
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

describe(@"blob properties can be accessed", ^{
beforeEach(^{
repository = self.bareFixtureRepository;
repository = QuickSpec.current.bareFixtureRepository;
blobSHA = @"fa49b077972391ad58037050f2a75f74e3671e92";
blob = [repository lookUpObjectBySHA:blobSHA objectType:GTObjectTypeBlob error:NULL];
expect(blob).notTo(beNil());
Expand All @@ -45,7 +45,7 @@

describe(@"blobs can be created", ^{
beforeEach(^{
repository = self.testAppFixtureRepository;
repository = QuickSpec.current.testAppFixtureRepository;
});

describe(@"+blobWithString:inRepository:error", ^{
Expand Down Expand Up @@ -92,7 +92,7 @@
});

afterEach(^{
[self tearDown];
[QuickSpec.current tearDown];
});

QuickSpecEnd
6 changes: 3 additions & 3 deletions ObjectiveGitTests/GTBranchSpec.m
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
__block GTBranch *trackingBranch;

beforeEach(^{
repository = self.testAppFixtureRepository;
repository = QuickSpec.current.testAppFixtureRepository;
expect(repository).notTo(beNil());

NSError *error = nil;
Expand Down Expand Up @@ -240,7 +240,7 @@
});

it(@"should set a remote tracking branch without branches amount change", ^{
GTRepository *repository = self.testAppForkFixtureRepository;
GTRepository *repository = QuickSpec.current.testAppForkFixtureRepository;
expect(repository).notTo(beNil());

NSError *error = nil;
Expand Down Expand Up @@ -307,7 +307,7 @@
});

afterEach(^{
[self tearDown];
[QuickSpec.current tearDown];
});

QuickSpecEnd
4 changes: 2 additions & 2 deletions ObjectiveGitTests/GTCommitSpec.m
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
__block GTRepository *repository;

beforeEach(^{
repository = self.bareFixtureRepository;
repository = QuickSpec.current.bareFixtureRepository;
});

it(@"can read commit data", ^{
Expand Down Expand Up @@ -81,7 +81,7 @@
});

afterEach(^{
[self tearDown];
[QuickSpec.current tearDown];
});

QuickSpecEnd
2 changes: 1 addition & 1 deletion ObjectiveGitTests/GTConfigurationSpec.m
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
});

afterEach(^{
[self tearDown];
[QuickSpec.current tearDown];
});

QuickSpecEnd
2 changes: 1 addition & 1 deletion ObjectiveGitTests/GTDiffDeltaSpec.m
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
__block GTDiffDelta *delta;

beforeEach(^{
repository = [self testAppFixtureRepository];
repository = [QuickSpec.current testAppFixtureRepository];
});

describe(@"blob-to-blob diffing", ^{
Expand Down
6 changes: 3 additions & 3 deletions ObjectiveGitTests/GTDiffSpec.m
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
__block GTCommit *secondCommit = nil;

beforeEach(^{
repository = self.testAppFixtureRepository;
repository = QuickSpec.current.testAppFixtureRepository;
expect(repository).notTo(beNil());

firstCommit = (GTCommit *)[repository lookUpObjectBySHA:@"8e0e65988d3007867a9f59ca8639ba975ef97e69" objectType:GTObjectTypeCommit error:NULL];
Expand Down Expand Up @@ -72,7 +72,7 @@
__block void (^setupDiffFromCommitSHAsAndOptions)(NSString *, NSString *, NSDictionary *) = nil;

beforeEach(^{
repository = self.testAppFixtureRepository;
repository = QuickSpec.current.testAppFixtureRepository;
expect(repository).notTo(beNil());

setupDiffFromCommitSHAsAndOptions = [^(NSString *firstCommitSHA, NSString *secondCommitSHA, NSDictionary *options) {
Expand Down Expand Up @@ -294,7 +294,7 @@
});

afterEach(^{
[self tearDown];
[QuickSpec.current tearDown];
});

QuickSpecEnd
4 changes: 2 additions & 2 deletions ObjectiveGitTests/GTEnumeratorSpec.m
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
__block GTEnumerator *enumerator;

beforeEach(^{
repo = self.bareFixtureRepository;
repo = QuickSpec.current.bareFixtureRepository;
expect(repo).notTo(beNil());

enumerator = [[GTEnumerator alloc] initWithRepository:repo error:NULL];
Expand Down Expand Up @@ -152,7 +152,7 @@
});

afterEach(^{
[self tearDown];
[QuickSpec.current tearDown];
});

QuickSpecEnd
6 changes: 3 additions & 3 deletions ObjectiveGitTests/GTFilterListSpec.m
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
NSString *textFilterContent = @"\nohai text-filter!";

beforeEach(^{
repository = self.testAppFixtureRepository;
repository = QuickSpec.current.testAppFixtureRepository;

NSString *attributes = @"READ* rf=true\n*.txt tf=true\n";
BOOL success = [attributes writeToURL:[repository.fileURL URLByAppendingPathComponent:@".gitattributes"] atomically:YES encoding:NSUTF8StringEncoding error:NULL];
Expand Down Expand Up @@ -144,7 +144,7 @@

it(@"should apply to a file", ^{
NSString *inputFilename = @"README";
GTRepository *inputRepo = self.conflictedFixtureRepository;
GTRepository *inputRepo = QuickSpec.current.conflictedFixtureRepository;

NSString *content = [NSString stringWithContentsOfURL:[inputRepo.fileURL URLByAppendingPathComponent:inputFilename] encoding:NSUTF8StringEncoding error:NULL];
expect(content).notTo(contain(readFilterContent));
Expand Down Expand Up @@ -183,7 +183,7 @@
});

afterEach(^{
[self tearDown];
[QuickSpec.current tearDown];
});

QuickSpecEnd
4 changes: 2 additions & 2 deletions ObjectiveGitTests/GTFilterSpec.m
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
__block void (^setUpFilterWithApplyBlock)(GTFilterApplyBlock block);

beforeEach(^{
repository = self.testAppFixtureRepository;
repository = QuickSpec.current.testAppFixtureRepository;
expect(repository).notTo(beNil());

NSString *attributes = @"*.txt special\n";
Expand Down Expand Up @@ -184,7 +184,7 @@
});

afterEach(^{
[self tearDown];
[QuickSpec.current tearDown];
});

QuickSpecEnd
20 changes: 10 additions & 10 deletions ObjectiveGitTests/GTIndexSpec.m
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
__block GTIndex *index;

beforeEach(^{
repository = self.testAppFixtureRepository;
repository = QuickSpec.current.testAppFixtureRepository;

index = [repository indexWithError:NULL];
expect(index).notTo(beNil());
Expand Down Expand Up @@ -51,7 +51,7 @@
});

it(@"should write to a specific repository and return a tree", ^{
GTRepository *repository = self.bareFixtureRepository;
GTRepository *repository = QuickSpec.current.bareFixtureRepository;
NSArray *branches = [repository branches:NULL];
GTCommit *masterCommit = [branches[0] targetCommitWithError:NULL];
GTCommit *packedCommit = [branches[1] targetCommitWithError:NULL];
Expand Down Expand Up @@ -115,13 +115,13 @@
});

it(@"should correctly report conflicts", ^{
index = [self.conflictedFixtureRepository indexWithError:NULL];
index = [QuickSpec.current.conflictedFixtureRepository indexWithError:NULL];
expect(index).notTo(beNil());
expect(@(index.hasConflicts)).to(beTruthy());
});

it(@"should enumerate conflicts successfully", ^{
index = [self.conflictedFixtureRepository indexWithError:NULL];
index = [QuickSpec.current.conflictedFixtureRepository indexWithError:NULL];
expect(index).notTo(beNil());

NSError *err = NULL;
Expand All @@ -141,8 +141,8 @@
describe(@"updating pathspecs", ^{
NSString *fileName = @"REAME_";
beforeEach(^{
index = [self.testAppFixtureRepository indexWithError:NULL];
NSString *filePath = [self.testAppFixtureRepository.fileURL.path stringByAppendingPathComponent:fileName];
index = [QuickSpec.current.testAppFixtureRepository indexWithError:NULL];
NSString *filePath = [QuickSpec.current.testAppFixtureRepository.fileURL.path stringByAppendingPathComponent:fileName];
[@"The wild west..." writeToFile:filePath atomically:NO encoding:NSUTF8StringEncoding error:NULL];

expect(index).notTo(beNil());
Expand Down Expand Up @@ -175,7 +175,7 @@

it(@"should stop be able to stop early", ^{
NSString *otherFileName = @"TestAppDelegate.h";
[@"WELP" writeToFile:[self.testAppFixtureRepository.fileURL.path stringByAppendingPathComponent:otherFileName] atomically:NO encoding:NSUTF8StringEncoding error:NULL];
[@"WELP" writeToFile:[QuickSpec.current.testAppFixtureRepository.fileURL.path stringByAppendingPathComponent:otherFileName] atomically:NO encoding:NSUTF8StringEncoding error:NULL];
BOOL success = [index updatePathspecs:NULL error:NULL passingTest:^(NSString *matchedPathspec, NSString *path, BOOL *stop) {
if ([path.lastPathComponent isEqualToString:fileName]) {
*stop = YES;
Expand Down Expand Up @@ -212,7 +212,7 @@

beforeEach(^{
expect(filename).to(equal([filename precomposedStringWithCanonicalMapping]));
repo = self.testUnicodeFixtureRepository;
repo = QuickSpec.current.testUnicodeFixtureRepository;
configuration = [repo configurationWithError:NULL];

[configuration setBool:false forKey:@"core.precomposeunicode"];
Expand Down Expand Up @@ -310,7 +310,7 @@

beforeEach(^{
error = nil;
repo = self.testUnicodeFixtureRepository;
repo = QuickSpec.current.testUnicodeFixtureRepository;
// Not sure why but it doesn't work with an in memory index
// index = [GTIndex inMemoryIndexWithRepository:repo error:&error];
index = [repo indexWithError:&error];
Expand All @@ -329,7 +329,7 @@
});

afterEach(^{
[self tearDown];
[QuickSpec.current tearDown];
});

QuickSpecEnd
4 changes: 2 additions & 2 deletions ObjectiveGitTests/GTNoteSpec.m
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
__block GTCommit *initialCommit;

beforeEach(^{
NSURL *fileURL = [self.tempDirectoryFileURL URLByAppendingPathComponent:[[NSUUID alloc] init].UUIDString isDirectory:NO];
NSURL *fileURL = [QuickSpec.current.tempDirectoryFileURL URLByAppendingPathComponent:[[NSUUID alloc] init].UUIDString isDirectory:NO];
repository = [GTRepository initializeEmptyRepositoryAtFileURL:fileURL options:nil error:NULL];
expect(repository).notTo(beNil());

Expand Down Expand Up @@ -81,7 +81,7 @@
});

afterEach(^{
[self tearDown];
[QuickSpec.current tearDown];
});

QuickSpecEnd
2 changes: 1 addition & 1 deletion ObjectiveGitTests/GTOIDSpec.m
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
});

afterEach(^{
[self tearDown];
[QuickSpec.current tearDown];
});

QuickSpecEnd
4 changes: 2 additions & 2 deletions ObjectiveGitTests/GTObjectDatabaseSpec.m
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
__block GTObjectDatabase *database;

beforeEach(^{
GTRepository *repo = self.bareFixtureRepository;
GTRepository *repo = QuickSpec.current.bareFixtureRepository;
expect(repo).notTo(beNil());

database = [repo objectDatabaseWithError:NULL];
Expand Down Expand Up @@ -75,7 +75,7 @@
});

afterEach(^{
[self tearDown];
[QuickSpec.current tearDown];
});

QuickSpecEnd
2 changes: 1 addition & 1 deletion ObjectiveGitTests/GTObjectSpec.m
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
__block GTRepository *repo;

beforeEach(^{
repo = self.bareFixtureRepository;
repo = QuickSpec.current.bareFixtureRepository;
});

it(@"should fail to look up an empty string", ^{
Expand Down
Loading
Loading