Skip to content

Commit 0871b0e

Browse files
committed
Merge remote-tracking branch 'upstream/master'
# Conflicts: # External/libgit2
2 parents 41279e4 + 4dd0f7c commit 0871b0e

File tree

19 files changed

+123
-414
lines changed

19 files changed

+123
-414
lines changed

.travis.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
11
osx_image: xcode7
22
language: objective-c
33
matrix:
4+
fast_finish: true
45
include:
5-
- osx_image: xcode7
6-
env: SCHEME="ObjectiveGit Mac"
7-
- osx_image: xcode7
8-
env: SCHEME="ObjectiveGit iOS"
6+
- osx_image: xcode7.3
7+
env:
8+
- SCHEME="ObjectiveGit Mac"
9+
- osx_image: xcode7.3
10+
env:
11+
- SCHEME="ObjectiveGit iOS"
912
before_install:
10-
- brew update
11-
- brew outdated xctool || brew upgrade xctool
13+
- gem install xcpretty
14+
- gem install xcpretty-travis-formatter
1215
install: script/bootstrap
1316
script: script/cibuild
1417
notifications:

Cartfile.private

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
github "jspahrsummers/xcconfigs" >= 0.7.1
2-
github "Quick/Quick" ~> 0.9.1
3-
github "Quick/Nimble" ~> 3.1
2+
github "Quick/Quick" ~> 0.9.2
3+
github "Quick/Nimble" ~> 4.0
44
github "ZipArchive/ZipArchive" ~> 1.1

Cartfile.resolved

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
github "Quick/Nimble" "v3.1.0"
2-
github "Quick/Quick" "v0.9.1"
1+
github "Quick/Nimble" "v4.0.0"
2+
github "Quick/Quick" "v0.9.2"
33
github "ZipArchive/ZipArchive" "v1.1"
44
github "jspahrsummers/xcconfigs" "0.9"

Carthage/Checkouts/Nimble

Submodule Nimble updated 133 files

Carthage/Checkouts/Quick

Submodule Quick updated 59 files

ObjectiveGit/GTTreeBuilder.m

Lines changed: 4 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,6 @@ @interface GTTreeBuilder ()
4343
@property (nonatomic, assign, readonly) git_treebuilder *git_treebuilder;
4444
@property (nonatomic, strong, readonly) GTRepository *repository;
4545

46-
// Data to be written with the tree, keyed by the file name. This should only be
47-
// accessed while synchronized on self.
48-
//
49-
// This is needed because we don't want to add the entries to the object
50-
// database until the tree's been written.
51-
@property (nonatomic, strong, readonly) NSMutableDictionary *fileNameToPendingData;
52-
5346
@end
5447

5548
@implementation GTTreeBuilder
@@ -80,8 +73,6 @@ - (instancetype)initWithTree:(GTTree *)treeOrNil repository:(GTRepository *)repo
8073
}
8174

8275
_repository = repository;
83-
_fileNameToPendingData = [NSMutableDictionary dictionary];
84-
8576
return self;
8677
}
8778

@@ -122,12 +113,11 @@ - (GTTreeEntry *)addEntryWithData:(NSData *)data fileName:(NSString *)fileName f
122113
NSParameterAssert(data != nil);
123114
NSParameterAssert(fileName != nil);
124115

125-
GTOID *OID = [GTOID OIDByHashingData:data type:GTObjectTypeBlob error:error];
126-
if (OID == nil) return nil;
116+
GTObjectDatabase *odb = [self.repository objectDatabaseWithError:error];
117+
if (odb == nil) return nil;
127118

128-
@synchronized (self) {
129-
self.fileNameToPendingData[fileName] = data;
130-
}
119+
GTOID *OID = [odb writeData:data type:GTObjectTypeBlob error:error];
120+
if (OID == nil) return nil;
131121

132122
return [self addEntryWithOID:OID fileName:fileName fileMode:fileMode error:error];
133123
}
@@ -153,38 +143,10 @@ - (BOOL)removeEntryWithFileName:(NSString *)fileName error:(NSError **)error {
153143
if (error != NULL) *error = [NSError git_errorFor:status description:@"Failed to remove entry with name %@ from tree builder.", fileName];
154144
}
155145

156-
@synchronized (self) {
157-
[self.fileNameToPendingData removeObjectForKey:fileName];
158-
}
159-
160146
return status == GIT_OK;
161147
}
162148

163-
- (BOOL)writePendingData:(NSError **)error {
164-
NSDictionary *copied;
165-
@synchronized (self) {
166-
copied = [self.fileNameToPendingData copy];
167-
[self.fileNameToPendingData removeAllObjects];
168-
}
169-
170-
if (copied.count != 0) {
171-
GTObjectDatabase *odb = [self.repository objectDatabaseWithError:error];
172-
if (odb == nil) return NO;
173-
174-
for (NSString *fileName in copied) {
175-
NSData *data = copied[fileName];
176-
GTOID *dataOID = [odb writeData:data type:GTObjectTypeBlob error:error];
177-
if (dataOID == nil) return NO;
178-
}
179-
}
180-
181-
return YES;
182-
}
183-
184149
- (GTTree *)writeTree:(NSError **)error {
185-
BOOL success = [self writePendingData:error];
186-
if (!success) return nil;
187-
188150
git_oid treeOid;
189151
int status = git_treebuilder_write(&treeOid, self.git_treebuilder);
190152
if (status != GIT_OK) {

ObjectiveGitFramework.xcodeproj/project.pbxproj

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2235,7 +2235,6 @@
22352235
GCC_WARN_UNUSED_VARIABLE = YES;
22362236
HEADER_SEARCH_PATHS = "$(inherited)";
22372237
INFOPLIST_FILE = "ObjectiveGitTests/ObjectiveGitTests-Info.plist";
2238-
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
22392238
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
22402239
LIBRARY_SEARCH_PATHS = (
22412240
.,
@@ -2281,7 +2280,6 @@
22812280
GCC_WARN_UNUSED_VARIABLE = YES;
22822281
HEADER_SEARCH_PATHS = "$(inherited)";
22832282
INFOPLIST_FILE = "ObjectiveGitTests/ObjectiveGitTests-Info.plist";
2284-
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
22852283
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
22862284
LIBRARY_SEARCH_PATHS = (
22872285
.,
@@ -2328,7 +2326,6 @@
23282326
GCC_WARN_UNUSED_VARIABLE = YES;
23292327
HEADER_SEARCH_PATHS = "$(inherited)";
23302328
INFOPLIST_FILE = "ObjectiveGitTests/ObjectiveGitTests-Info.plist";
2331-
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
23322329
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
23332330
LIBRARY_SEARCH_PATHS = (
23342331
.,
@@ -2375,7 +2372,6 @@
23752372
GCC_WARN_UNUSED_VARIABLE = YES;
23762373
HEADER_SEARCH_PATHS = "$(inherited)";
23772374
INFOPLIST_FILE = "ObjectiveGitTests/ObjectiveGitTests-Info.plist";
2378-
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
23792375
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
23802376
LIBRARY_SEARCH_PATHS = (
23812377
.,

ObjectiveGitTests/GTOIDSpec.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
const git_oid *git_oid = NULL;
4949

5050
{
51-
GTOID *testOID __attribute__((objc_precise_lifetime)) = [[GTOID alloc] initWithSHA:testSHA];
51+
GTOID *testOID = [[GTOID alloc] initWithSHA:testSHA];
5252
git_oid = testOID.git_oid;
5353
}
5454

ObjectiveGitTests/GTSignatureSpec.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
const git_signature *git_signature = NULL;
5050

5151
{
52-
GTSignature *testSignature __attribute__((objc_precise_lifetime)) = [[GTSignature alloc] initWithName:name email:email time:time];
52+
GTSignature *testSignature = [[GTSignature alloc] initWithName:name email:email time:time];
5353
git_signature = testSignature.git_signature;
5454
}
5555

ObjectiveGitTests/GTTreeBuilderSpec.m

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,19 +103,17 @@
103103
expect(foundEntry.SHA).to(equal(entry.SHA));
104104
});
105105

106-
it(@"should write new blobs when the tree is written", ^{
106+
it(@"should be possible to write a blob with data", ^{
107107
GTTreeEntry *entry = [builder addEntryWithData:[@"Hello, World!" dataUsingEncoding:NSUTF8StringEncoding] fileName:@"test.txt" fileMode:GTFileModeBlob error:NULL];
108108
expect(entry).notTo(beNil());
109109

110110
GTObjectDatabase *database = [repo objectDatabaseWithError:NULL];
111111
expect(database).notTo(beNil());
112112

113-
expect(@([database containsObjectWithOID:entry.OID])).to(beFalsy());
113+
expect(@([database containsObjectWithOID:entry.OID])).to(beTruthy());
114114

115115
GTTree *tree = [builder writeTree:NULL];
116116
expect(tree).notTo(beNil());
117-
118-
expect(@([database containsObjectWithOID:entry.OID])).to(beTruthy());
119117
});
120118

121119
it(@"should be possible to write a builder to a repository", ^{

0 commit comments

Comments
 (0)