Skip to content

Commit 31354b1

Browse files
committed
Disable GIT_OPT_ENABLE_STRICT_OBJECT_CREATION
1 parent 1f26eca commit 31354b1

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

ObjectiveGitTests/GTRepositoryCommittingSpec.m

+2
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
});
2828

2929
it(@"can create commits", ^{
30+
git_libgit2_opts(GIT_OPT_ENABLE_STRICT_OBJECT_CREATION, 0);
3031
GTTreeBuilder *builder = [[GTTreeBuilder alloc] initWithTree:nil repository:repository error:NULL];
3132
expect(builder).notTo(beNil());
3233

@@ -53,6 +54,7 @@
5354
GTReference *ref = [repository headReferenceWithError:NULL];
5455
expect(ref).notTo(beNil());
5556
expect(ref.resolvedTarget).to(equal(initialCommit));
57+
git_libgit2_opts(GIT_OPT_ENABLE_STRICT_OBJECT_CREATION, 1);
5658
});
5759

5860
afterEach(^{

ObjectiveGitTests/GTTreeBuilderSpec.m

+2
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,9 @@
104104
});
105105

106106
it(@"should write new blobs when the tree is written", ^{
107+
git_libgit2_opts(GIT_OPT_ENABLE_STRICT_OBJECT_CREATION, 0);
107108
GTTreeEntry *entry = [builder addEntryWithData:[@"Hello, World!" dataUsingEncoding:NSUTF8StringEncoding] fileName:@"test.txt" fileMode:GTFileModeBlob error:NULL];
109+
git_libgit2_opts(GIT_OPT_ENABLE_STRICT_OBJECT_CREATION, 1);
108110
expect(entry).notTo(beNil());
109111

110112
GTObjectDatabase *database = [repo objectDatabaseWithError:NULL];

ObjectiveGitTests/GTUtilityFunctions.m

+2
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,10 @@
1919
GTBranch *branch = [GTBranch branchWithReference:head repository:repo];
2020
GTCommit *headCommit = [branch targetCommitWithError:NULL];
2121

22+
git_libgit2_opts(GIT_OPT_ENABLE_STRICT_OBJECT_CREATION, 0);
2223
GTTreeBuilder *treeBuilder = [[GTTreeBuilder alloc] initWithTree:headCommit.tree repository:repo error:nil];
2324
[treeBuilder addEntryWithData:fileData fileName:fileName fileMode:GTFileModeBlob error:nil];
25+
git_libgit2_opts(GIT_OPT_ENABLE_STRICT_OBJECT_CREATION, 1);
2426

2527
GTTree *testTree = [treeBuilder writeTree:nil];
2628

0 commit comments

Comments
 (0)