Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
e21b474
++xcconfigs
jspahrsummers Jul 16, 2014
2bbb323
Don't automatically build unit tests
jspahrsummers Jul 16, 2014
15ef482
Merge branch 'master' into xcode6
jspahrsummers Oct 22, 2014
9cd0d09
++xcconfigs
jspahrsummers Oct 22, 2014
ab79cba
Remove Specta and Expecta
jspahrsummers Oct 22, 2014
0accdcc
Add github/Quick as a submodule
jspahrsummers Oct 22, 2014
1097ad8
Rename Mac target/scheme for clarity
jspahrsummers Oct 22, 2014
bdd9990
Recreate iOS as a framework, fix build settings
jspahrsummers Oct 22, 2014
17f5d6a
Fix Mac build
jspahrsummers Oct 22, 2014
88ee2eb
Update to jspahrsummers/objc-build-scripts@a54782c
jspahrsummers Oct 22, 2014
4458400
Add some linker flags to the iOS build
jspahrsummers Oct 22, 2014
0f74742
Ignore incomplete umbrella warnings
jspahrsummers Oct 23, 2014
84a100a
Link Quick and Nimble into test targets
jspahrsummers Oct 23, 2014
17c6846
Refactor GTTestCase into category on QuickSpec
jspahrsummers Oct 23, 2014
c848926
Upgrade GTObjectTest as GTObjectSpec
jspahrsummers Oct 23, 2014
6696177
Migrate specs to use Quick
jspahrsummers Oct 23, 2014
7a89f74
Find and replace Expecta with Nimble
jspahrsummers Oct 23, 2014
89eb173
Migrate specs to Nimble matchers
jspahrsummers Oct 23, 2014
40d7057
Remove dead Specta and Expecta references
jspahrsummers Oct 23, 2014
f176b3b
Add dummy SwiftSpec file
jspahrsummers Oct 23, 2014
0c85456
Bump OS X deployment target for tests
jspahrsummers Oct 23, 2014
8a9faee
Work around bug with Nimble's contain() matcher
jspahrsummers Oct 23, 2014
884c069
Clean up imports, use angle bracket style
jspahrsummers Oct 23, 2014
77731ce
Sprinkle some missing Foundation imports
jspahrsummers Oct 23, 2014
94aee06
Revert angle bracket imports
jspahrsummers Oct 23, 2014
e918f67
Rename Classes folder to ObjectiveGit for searches
jspahrsummers Oct 23, 2014
513565b
Fix some more janky imports
jspahrsummers Oct 23, 2014
2e35a2e
Moar screwy imports
jspahrsummers Oct 23, 2014
8443b01
uggggggggggggggghhhhhhhhhhhhhhhh imports
jspahrsummers Oct 23, 2014
f857e25
FUCK IMPORTS
jspahrsummers Oct 23, 2014
d4ae582
I M P O R T S
jspahrsummers Oct 23, 2014
7df0a10
Restore some iOS search paths
jspahrsummers Oct 23, 2014
f6c4f49
Fix dumb typo in name of library to link
jspahrsummers Oct 23, 2014
974075a
Link libssl for iOS too
jspahrsummers Oct 23, 2014
fcbc503
Try completely different linker flags
jspahrsummers Oct 23, 2014
8446d4a
Revert "Try completely different linker flags"
jspahrsummers Oct 24, 2014
440d67c
i have no idea what i'm doing dog
jspahrsummers Oct 24, 2014
34ee652
Fix libssh2 library name?
jspahrsummers Oct 24, 2014
f889faf
OpenSSL -> 1.0.1j
alanjrogers Oct 28, 2014
c32fe34
Skip installing man pages to avoid too many symlink errors.
alanjrogers Oct 28, 2014
af576d4
Compile EXTScope.
alanjrogers Oct 28, 2014
82fc85c
Link lib and libiconv.
alanjrogers Oct 28, 2014
1e02f02
Remove set -e because lol.
alanjrogers Oct 28, 2014
f8ff8a6
Don't try and link .a's in the External folder.
alanjrogers Oct 28, 2014
e9d2500
Don't copy this in resources.
alanjrogers Oct 28, 2014
1c83da1
Add git2 folder and git2.h to public headers.
alanjrogers Oct 28, 2014
af254df
Move libiconv and libz iOS references.
alanjrogers Oct 28, 2014
c989dae
Xcode seems to need this duplicate reference. :rage:
alanjrogers Oct 28, 2014
8274e20
Make sure libgit2 is in the header paths for iOS
jspahrsummers Oct 28, 2014
25421f7
Fix some warnings in specs
jspahrsummers Oct 28, 2014
3de6412
I have had it with these motherfucking deprecations in this motherfuc…
jspahrsummers Oct 28, 2014
0dadd24
Merge pull request #416 from libgit2/fix-ios-buildscripts
jspahrsummers Oct 28, 2014
55a920b
Delete the iOS unit test target.
alanjrogers Oct 28, 2014
d53cf34
Fix some build setting inheritance
jspahrsummers Oct 28, 2014
630737f
Merge remote-tracking branch 'origin/master' into xcode6
jspahrsummers Oct 28, 2014
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
9 changes: 3 additions & 6 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
[submodule "libgit2"]
path = External/libgit2
url = https://github.com/libgit2/libgit2.git
[submodule "ObjectiveGitTests/specta"]
path = ObjectiveGitTests/specta
url = https://github.com/specta/specta.git
[submodule "ObjectiveGitTests/expecta"]
path = ObjectiveGitTests/expecta
url = https://github.com/specta/expecta.git
[submodule "Configuration"]
path = External/Configuration
url = https://github.com/jspahrsummers/xcconfigs.git
Expand All @@ -16,3 +10,6 @@
[submodule "libssh2"]
path = External/libssh2
url = git://git.libssh2.org/libssh2.git
[submodule "External/Quick"]
path = External/Quick
url = https://github.com/github/Quick.git
2 changes: 1 addition & 1 deletion External/Configuration
1 change: 1 addition & 0 deletions External/Quick
Submodule Quick added at 30395c
2 changes: 1 addition & 1 deletion External/openssl
Submodule openssl updated 378 files
14 changes: 6 additions & 8 deletions Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,23 @@
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<string>en</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIconFile</key>
<string></string>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>com.github.${PRODUCT_NAME:rfc1034Identifier}</string>
<string>org.libgit2.$(PRODUCT_NAME:rfc1034identifier)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>${PRODUCT_NAME}</string>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>0.1</string>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSPrincipalClass</key>
<string></string>
</dict>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// NSData+Git.h
//

#import <Foundation/Foundation.h>
#import "git2.h"

@interface NSData (Git)
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
// THE SOFTWARE.
//

#import <Foundation/Foundation.h>

extern NSString * const GTGitErrorDomain;

@interface NSError (Git)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
//

#import "NSError+Git.h"
#include "git2.h"
#import "git2.h"

NSString * const GTGitErrorDomain = @"GTGitErrorDomain";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
// THE SOFTWARE.
//

#include "git2.h"
#import <Foundation/Foundation.h>
#import "git2.h"

@interface NSString (Git)

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion Classes/GTCommit.m → ObjectiveGit/GTCommit.m
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ - (GTTree *)tree {
int gitError = git_commit_tree(&tree, self.git_commit);
if (gitError < GIT_OK) {
// todo: might want to return this error (and change method signature)
GTLog("Failed to get tree with error code: %d", gitError);
NSLog(@"Failed to get tree with error code: %d", gitError);
return nil;
}

Expand Down
3 changes: 2 additions & 1 deletion Classes/GTConfiguration.h → ObjectiveGit/GTConfiguration.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
// Copyright (c) 2011 GitHub, Inc. All rights reserved.
//

#include "git2.h"
#import <Foundation/Foundation.h>
#import "git2.h"

@class GTRepository;
@class GTSignature;
Expand Down
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions Classes/GTCredential.h → ObjectiveGit/GTCredential.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
// Copyright (c) 2013 GitHub, Inc. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "git2.h"

/// An enum describing the data needed for authentication.
Expand Down
2 changes: 1 addition & 1 deletion Classes/GTCredential.m → ObjectiveGit/GTCredential.m
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
// Copyright (c) 2013 GitHub, Inc. All rights reserved.
//

#import <ObjectiveGit/NSError+Git.h>
#import "GTCredential.h"
#import "GTCredential+Private.h"
#import "NSError+Git.h"

typedef GTCredential *(^GTCredentialProviderBlock)(GTCredentialType allowedTypes, NSString *URL, NSString *userName);

Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion Classes/GTDiff.h → ObjectiveGit/GTDiff.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
// Copyright (c) 2012 GitHub, Inc. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "git2.h"

#import "GTDiffDelta.h"

@class GTDiffDelta;
Expand Down
File renamed without changes.
1 change: 1 addition & 0 deletions Classes/GTDiffDelta.h → ObjectiveGit/GTDiffDelta.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
// Copyright (c) 2012 GitHub, Inc. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "git2.h"
#import "GTDiffFile.h"

Expand Down
File renamed without changes.
1 change: 1 addition & 0 deletions Classes/GTDiffFile.h → ObjectiveGit/GTDiffFile.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
// Copyright (c) 2012 GitHub, Inc. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "git2.h"

/// Flags which may be set on the file.
Expand Down
File renamed without changes.
1 change: 1 addition & 0 deletions Classes/GTDiffHunk.h → ObjectiveGit/GTDiffHunk.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
// Copyright (c) 2012 GitHub, Inc. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "git2.h"

@class GTDiffLine;
Expand Down
File renamed without changes.
1 change: 1 addition & 0 deletions Classes/GTDiffLine.h → ObjectiveGit/GTDiffLine.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
// Copyright (c) 2012 GitHub, Inc. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "git2.h"

/// A character representing the origin of a given line.
Expand Down
File renamed without changes.
1 change: 1 addition & 0 deletions Classes/GTDiffPatch.h → ObjectiveGit/GTDiffPatch.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
// Copyright (c) 2014 GitHub, Inc. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "git2.h"

@class GTDiffHunk;
Expand Down
File renamed without changes.
1 change: 1 addition & 0 deletions Classes/GTEnumerator.h → ObjectiveGit/GTEnumerator.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
// THE SOFTWARE.
//

#import <Foundation/Foundation.h>
#import "GTObject.h"

/// Options to specify enumeration order when enumerating through a repository.
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions Classes/GTIndex.h → ObjectiveGit/GTIndex.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
// THE SOFTWARE.
//

#import <Foundation/Foundation.h>
#include "git2.h"

@class GTIndexEntry;
Expand Down
42 changes: 22 additions & 20 deletions Classes/GTIndex.m → ObjectiveGit/GTIndex.m
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,16 @@
//

#import "GTIndex.h"
#import "GTIndexEntry.h"
#import "NSError+Git.h"
#import "GTRepository.h"
#import "GTRepository+Private.h"

#import "EXTScope.h"
#import "GTConfiguration.h"
#import "GTIndexEntry.h"
#import "GTOID.h"
#import "GTRepository+Private.h"
#import "GTRepository.h"
#import "GTTree.h"
#import "EXTScope.h"
#import "NSArray+StringArray.h"
#import "NSError+Git.h"

// The block synonymous with libgit2's `git_index_matched_path_cb` callback.
typedef BOOL (^GTIndexPathspecMatchedBlock)(NSString *matchedPathspec, NSString *path, BOOL *stop);
Expand Down Expand Up @@ -196,7 +198,7 @@ - (BOOL)removeFile:(NSString *)file error:(NSError **)error {
if (error != NULL) *error = [NSError git_errorFor:status description:@"Failed to remove file %@ from index.", file];
return NO;
}

return YES;
}

Expand All @@ -212,7 +214,7 @@ - (BOOL)write:(NSError **)error {

- (GTTree *)writeTree:(NSError **)error {
git_oid oid;

int status = git_index_write_tree(&oid, self.git_index);
if (status != GIT_OK) {
if (error != NULL) *error = [NSError git_errorFor:status description:@"Failed to write index."];
Expand All @@ -225,13 +227,13 @@ - (GTTree *)writeTree:(NSError **)error {
- (GTTree *)writeTreeToRepository:(GTRepository *)repository error:(NSError **)error {
NSParameterAssert(repository != nil);
git_oid oid;

int status = git_index_write_tree_to(&oid, self.git_index, repository.git_repository);
if (status != GIT_OK) {
if (error != NULL) *error = [NSError git_errorFor:status description:@"Failed to write index to repository %@", repository];
return NULL;
}

return [repository lookUpObjectByGitOid:&oid objectType:GTObjectTypeTree error:NULL];
}

Expand All @@ -253,31 +255,31 @@ - (BOOL)hasConflicts {
- (BOOL)enumerateConflictedFilesWithError:(NSError **)error usingBlock:(void (^)(GTIndexEntry *ancestor, GTIndexEntry *ours, GTIndexEntry *theirs, BOOL *stop))block {
NSParameterAssert(block != nil);
if (!self.hasConflicts) return YES;

git_index_conflict_iterator *iterator = NULL;
int returnCode = git_index_conflict_iterator_new(&iterator, self.git_index);
if (returnCode != GIT_OK) {
if (error != NULL) *error = [NSError git_errorFor:returnCode description:NSLocalizedString(@"Could not create git index iterator.", nil)];
return NO;
}

@onExit {
if (iterator != NULL) git_index_conflict_iterator_free(iterator);
};

while (YES) {
const git_index_entry *ancestor = NULL;
const git_index_entry *ours = NULL;
const git_index_entry *theirs = NULL;

returnCode = git_index_conflict_next(&ancestor, &ours, &theirs, iterator);
if (returnCode == GIT_ITEROVER) break;

if (returnCode != GIT_OK) {
if (error != NULL) *error = [NSError git_errorFor:returnCode description:NSLocalizedString(@"Could not iterate conflict.", nil)];
return NO;
}

GTIndexEntry *blockAncestor;
if (ancestor != NULL) {
blockAncestor = [[GTIndexEntry alloc] initWithGitIndexEntry:ancestor];
Expand All @@ -297,7 +299,7 @@ - (BOOL)enumerateConflictedFilesWithError:(NSError **)error usingBlock:(void (^)
block(blockAncestor, blockOurs, blockTheirs, &stop);
if (stop) break;
}

return YES;
}

Expand All @@ -308,7 +310,7 @@ - (BOOL)enumerateConflictedFilesWithError:(NSError **)error usingBlock:(void (^)

- (BOOL)updatePathspecs:(NSArray *)pathspecs error:(NSError **)error passingTest:(GTIndexPathspecMatchedBlock)block {
NSAssert(self.repository.isBare == NO, @"This method only works with non-bare repositories.");

const git_strarray strarray = pathspecs.git_strarray;
struct GTIndexPathspecMatchedInfo payload = {
.block = block,
Expand All @@ -320,7 +322,7 @@ - (BOOL)updatePathspecs:(NSArray *)pathspecs error:(NSError **)error passingTest
if (error != nil) *error = [NSError git_errorFor:returnCode description:NSLocalizedString(@"Could not update index.", nil)];
return NO;
}

return YES;
}

Expand All @@ -330,11 +332,11 @@ int GTIndexPathspecMatchFound(const char *path, const char *matched_pathspec, vo
if (info->shouldAbortImmediately) {
return GIT_EUSER;
}

BOOL shouldStop = NO;
NSString *matchedPathspec = (matched_pathspec != nil ? @(matched_pathspec): nil);
BOOL shouldUpdate = block(matchedPathspec, @(path), &shouldStop);

if (shouldUpdate) {
if (shouldStop) {
info->shouldAbortImmediately = YES;
Expand Down
1 change: 1 addition & 0 deletions Classes/GTIndexEntry.h → ObjectiveGit/GTIndexEntry.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
// THE SOFTWARE.
//

#import <Foundation/Foundation.h>
#include "git2.h"

typedef NS_ENUM(NSInteger, GTIndexEntryStatus) {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions Classes/GTObject.h → ObjectiveGit/GTObject.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
// THE SOFTWARE.
//

#include "git2.h"
#import <Foundation/Foundation.h>
#import "git2.h"

typedef NS_ENUM(int, GTObjectType) {
GTObjectTypeAny = GIT_OBJ_ANY, /**< Object can be any of the following */
Expand Down Expand Up @@ -80,4 +81,3 @@ typedef NS_ENUM(int, GTObjectType) {
- (id)objectByPeelingToType:(GTObjectType)type error:(NSError **)error;

@end

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading