Skip to content

Commit 95792ca

Browse files
committed
More changes
1 parent 31ca62a commit 95792ca

9 files changed

+21
-21
lines changed

ObjectiveGit/GTOID.m

+1-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ + (instancetype)oidWithSHACString:(const char *)SHA {
9898
}
9999

100100
- (BOOL)isZero {
101-
return git_oid_iszero(self.git_oid) != 0;
101+
return git_oid_is_zero(self.git_oid) != 0;
102102
}
103103

104104
#pragma mark NSObject

ObjectiveGit/GTRepository+Merging.m

+4-4
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
#import "GTOdbObject.h"
2121
#import "GTObjectDatabase.h"
2222

23-
typedef void (^GTRemoteFetchTransferProgressBlock)(const git_transfer_progress *stats, BOOL *stop);
23+
typedef void (^GTRemoteFetchTransferProgressBlock)(const git_indexer_progress *stats, BOOL *stop);
2424

2525
@implementation GTRepository (Merging)
2626

@@ -181,7 +181,7 @@ - (NSString * _Nullable)contentsOfDiffWithAncestor:(GTIndexEntry *)ancestor ourS
181181

182182
// initialize the ancestor's merge file input
183183
git_merge_file_input ancestorInput;
184-
int gitError = git_merge_file_init_input(&ancestorInput, GIT_MERGE_FILE_INPUT_VERSION);
184+
int gitError = git_merge_file_input_init(&ancestorInput, GIT_MERGE_FILE_INPUT_VERSION);
185185
if (gitError != GIT_OK) {
186186
if (error != NULL) *error = [NSError git_errorFor:gitError description:@"Failed to create merge file input for ancestor"];
187187
return nil;
@@ -199,7 +199,7 @@ - (NSString * _Nullable)contentsOfDiffWithAncestor:(GTIndexEntry *)ancestor ourS
199199

200200
// initialize our merge file input
201201
git_merge_file_input ourInput;
202-
gitError = git_merge_file_init_input(&ourInput, GIT_MERGE_FILE_INPUT_VERSION);
202+
gitError = git_merge_file_options_init(&ourInput, GIT_MERGE_FILE_INPUT_VERSION);
203203
if (gitError != GIT_OK) {
204204
if (error != NULL) *error = [NSError git_errorFor:gitError description:@"Failed to create merge file input for our side"];
205205
return nil;
@@ -217,7 +217,7 @@ - (NSString * _Nullable)contentsOfDiffWithAncestor:(GTIndexEntry *)ancestor ourS
217217

218218
// initialize their merge file input
219219
git_merge_file_input theirInput;
220-
gitError = git_merge_file_init_input(&theirInput, GIT_MERGE_FILE_INPUT_VERSION);
220+
gitError = git_merge_file_input_init(&theirInput, GIT_MERGE_FILE_INPUT_VERSION);
221221
if (gitError != GIT_OK) {
222222
if (error != NULL) *error = [NSError git_errorFor:gitError description:@"Failed to create merge file input other side"];
223223
return nil;

ObjectiveGit/GTRepository+Pull.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
NS_ASSUME_NONNULL_BEGIN
1212

13-
typedef void (^GTRemoteFetchTransferProgressBlock)(const git_transfer_progress *progress, BOOL *stop);
13+
typedef void (^GTRemoteFetchTransferProgressBlock)(const git_indexer_progress *progress, BOOL *stop);
1414

1515
@interface GTRepository (Pull)
1616

ObjectiveGit/GTRepository+RemoteOperations.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ typedef NS_ENUM(NSInteger, GTFetchPruneOption) {
5151
///
5252
/// Returns YES if the fetch was successful, NO otherwise (and `error`, if provided,
5353
/// will point to an error describing what happened).
54-
- (BOOL)fetchRemote:(GTRemote *)remote withOptions:(NSDictionary * _Nullable)options error:(NSError **)error progress:(void (^ _Nullable)(const git_transfer_progress *stats, BOOL *stop))progressBlock;
54+
- (BOOL)fetchRemote:(GTRemote *)remote withOptions:(NSDictionary * _Nullable)options error:(NSError **)error progress:(void (^ _Nullable)(const git_indexer_progress *stats, BOOL *stop))progressBlock;
5555

5656
/// Enumerate all available fetch head entries.
5757
///

ObjectiveGit/GTRepository+RemoteOperations.m

+3-3
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
NSString *const GTRepositoryRemoteOptionsDownloadTags = @"GTRepositoryRemoteOptionsDownloadTags";
3131
NSString *const GTRepositoryRemoteOptionsPushNotes = @"GTRepositoryRemoteOptionsPushNotes";
3232

33-
typedef void (^GTRemoteFetchTransferProgressBlock)(const git_transfer_progress *stats, BOOL *stop);
33+
typedef void (^GTRemoteFetchTransferProgressBlock)(const git_indexer_progress *stats, BOOL *stop);
3434
typedef void (^GTRemotePushTransferProgressBlock)(unsigned int current, unsigned int total, size_t bytes, BOOL *stop);
3535

3636
@implementation GTRepository (RemoteOperations)
@@ -45,7 +45,7 @@ @implementation GTRepository (RemoteOperations)
4545
git_direction direction;
4646
} GTRemoteConnectionInfo;
4747

48-
int GTRemoteFetchTransferProgressCallback(const git_transfer_progress *stats, void *payload) {
48+
int GTRemoteFetchTransferProgressCallback(const git_indexer_progress *stats, void *payload) {
4949
GTRemoteConnectionInfo *info = payload;
5050
BOOL stop = NO;
5151

@@ -281,7 +281,7 @@ - (BOOL)pushRefspecs:(NSArray *)refspecs toRemote:(GTRemote *)remote withOptions
281281

282282
git_push_options push_options = GIT_PUSH_OPTIONS_INIT;
283283

284-
gitError = git_push_init_options(&push_options, GIT_PUSH_OPTIONS_VERSION);
284+
gitError = git_push_options_init(&push_options, GIT_PUSH_OPTIONS_VERSION);
285285
if (gitError != GIT_OK) {
286286
if (error != NULL) *error = [NSError git_errorFor:gitError description:@"Failed to init push options"];
287287
return NO;

ObjectiveGit/GTRepository.m

+3-3
Original file line numberDiff line numberDiff line change
@@ -214,9 +214,9 @@ - (instancetype)initWithURL:(NSURL *)localFileURL flags:(NSInteger)flags ceiling
214214
}
215215

216216

217-
typedef void(^GTTransferProgressBlock)(const git_transfer_progress *progress, BOOL *stop);
217+
typedef void(^GTTransferProgressBlock)(const git_indexer_progress *progress, BOOL *stop);
218218

219-
static int transferProgressCallback(const git_transfer_progress *progress, void *payload) {
219+
static int transferProgressCallback(const git_indexer_progress *progress, void *payload) {
220220
if (payload == NULL) return 0;
221221
struct GTClonePayload *pld = payload;
222222
if (pld->transferProgressBlock == NULL) return 0;
@@ -244,7 +244,7 @@ static int remoteCreate(git_remote **remote, git_repository *repo, const char *n
244244
git_remote_callbacks remoteCallbacks;
245245
};
246246

247-
+ (instancetype _Nullable)cloneFromURL:(NSURL *)originURL toWorkingDirectory:(NSURL *)workdirURL options:(NSDictionary * _Nullable)options error:(NSError **)error transferProgressBlock:(void (^ _Nullable)(const git_transfer_progress *, BOOL *stop))transferProgressBlock {
247+
+ (instancetype _Nullable)cloneFromURL:(NSURL *)originURL toWorkingDirectory:(NSURL *)workdirURL options:(NSDictionary * _Nullable)options error:(NSError **)error transferProgressBlock:(void (^ _Nullable)(const git_indexer_progress *, BOOL *stop))transferProgressBlock {
248248

249249
git_clone_options cloneOptions = GIT_CLONE_OPTIONS_INIT;
250250

ObjectiveGitTests/GTRemoteSpec.m

+1-1
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@
180180

181181
__block unsigned int receivedObjects = 0;
182182
__block BOOL transferProgressed = NO;
183-
BOOL success = [fetchingRepo fetchRemote:remote withOptions:nil error:&error progress:^(const git_transfer_progress *stats, BOOL *stop) {
183+
BOOL success = [fetchingRepo fetchRemote:remote withOptions:nil error:&error progress:^(const git_indexer_progress *stats, BOOL *stop) {
184184
receivedObjects += stats->received_objects;
185185
transferProgressed = YES;
186186
}];

ObjectiveGitTests/GTRepository+PullSpec.m

+5-5
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@
7979

8080
// Pull
8181
__block BOOL transferProgressed = NO;
82-
BOOL result = [localRepo pullBranch:masterBranch fromRemote:remote withOptions:nil error:&error progress:^(const git_transfer_progress *progress, BOOL *stop) {
82+
BOOL result = [localRepo pullBranch:masterBranch fromRemote:remote withOptions:nil error:&error progress:^(const git_indexer_progress *progress, BOOL *stop) {
8383
transferProgressed = YES;
8484
}];
8585
expect(error).to(beNil());
@@ -124,7 +124,7 @@
124124
125125
// Pull
126126
__block BOOL transferProgressed = NO;
127-
BOOL result = [localRepo pullBranch:masterBranch fromRemote:remote withOptions:nil error:&error progress:^(const git_transfer_progress *progress, BOOL *stop) {
127+
BOOL result = [localRepo pullBranch:masterBranch fromRemote:remote withOptions:nil error:&error progress:^(const git_indexer_progress *progress, BOOL *stop) {
128128
transferProgressed = YES;
129129
}];
130130
expect(@(result)).to(beTruthy());
@@ -165,7 +165,7 @@
165165

166166
// Pull
167167
__block BOOL transferProgressed = NO;
168-
BOOL result = [localRepo pullBranch:masterBranch fromRemote:remote withOptions:nil error:&error progress:^(const git_transfer_progress *progress, BOOL *stop) {
168+
BOOL result = [localRepo pullBranch:masterBranch fromRemote:remote withOptions:nil error:&error progress:^(const git_indexer_progress *progress, BOOL *stop) {
169169
transferProgressed = YES;
170170
}];
171171
expect(error).to(beNil());
@@ -219,7 +219,7 @@
219219

220220
// Pull
221221
__block BOOL transferProgressed = NO;
222-
BOOL result = [localRepo pullBranch:masterBranch fromRemote:remote withOptions:nil error:&error progress:^(const git_transfer_progress *progress, BOOL *stop) {
222+
BOOL result = [localRepo pullBranch:masterBranch fromRemote:remote withOptions:nil error:&error progress:^(const git_indexer_progress *progress, BOOL *stop) {
223223
transferProgressed = YES;
224224
}];
225225
expect(@(result)).to(beTruthy());
@@ -251,7 +251,7 @@
251251

252252
// Pull
253253
__block BOOL transferProgressed = NO;
254-
BOOL result = [localRepo pullBranch:masterBranch fromRemote:remote withOptions:nil error:&error progress:^(const git_transfer_progress *progress, BOOL *stop) {
254+
BOOL result = [localRepo pullBranch:masterBranch fromRemote:remote withOptions:nil error:&error progress:^(const git_indexer_progress *progress, BOOL *stop) {
255255
transferProgressed = YES;
256256
}];
257257
NSString *fileContents = [NSString stringWithContentsOfURL:[localRepo.fileURL URLByAppendingPathComponent:@"test.txt"] encoding:NSUTF8StringEncoding error:nil];

ObjectiveGitTests/GTRepositorySpec.m

+2-2
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
describe(@"+cloneFromURL:toWorkingDirectory:options:error:transferProgressBlock:checkoutProgressBlock:", ^{
6969
__block BOOL transferProgressCalled = NO;
7070
__block BOOL checkoutProgressCalled = NO;
71-
__block void (^transferProgressBlock)(const git_transfer_progress *, BOOL *);
71+
__block void (^transferProgressBlock)(const git_indexer_progress *, BOOL *);
7272
__block void (^checkoutProgressBlock)(NSString *, NSUInteger, NSUInteger);
7373
__block NSURL *originURL;
7474
__block NSURL *workdirURL;
@@ -78,7 +78,7 @@
7878
beforeEach(^{
7979
transferProgressCalled = NO;
8080
checkoutProgressCalled = NO;
81-
transferProgressBlock = ^(const git_transfer_progress *progress, BOOL *stop) {
81+
transferProgressBlock = ^(const git_indexer_progress *progress, BOOL *stop) {
8282
transferProgressCalled = YES;
8383
};
8484
checkoutProgressBlock = ^(NSString *path, NSUInteger completedSteps, NSUInteger totalSteps) {

0 commit comments

Comments
 (0)