Skip to content

Commit

Permalink
More changes
Browse files Browse the repository at this point in the history
  • Loading branch information
hannesa2 committed Feb 15, 2022
1 parent bdbf788 commit e3fef5d
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 21 deletions.
2 changes: 1 addition & 1 deletion ObjectiveGit/GTOID.m
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ + (instancetype)oidWithSHACString:(const char *)SHA {
}

- (BOOL)isZero {
return git_oid_iszero(self.git_oid) != 0;
return git_oid_is_zero(self.git_oid) != 0;
}

#pragma mark NSObject
Expand Down
8 changes: 4 additions & 4 deletions ObjectiveGit/GTRepository+Merging.m
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#import "GTOdbObject.h"
#import "GTObjectDatabase.h"

typedef void (^GTRemoteFetchTransferProgressBlock)(const git_transfer_progress *stats, BOOL *stop);
typedef void (^GTRemoteFetchTransferProgressBlock)(const git_indexer_progress *stats, BOOL *stop);

@implementation GTRepository (Merging)

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

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

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

// initialize their merge file input
git_merge_file_input theirInput;
gitError = git_merge_file_init_input(&theirInput, GIT_MERGE_FILE_INPUT_VERSION);
gitError = git_merge_file_input_init(&theirInput, GIT_MERGE_FILE_INPUT_VERSION);
if (gitError != GIT_OK) {
if (error != NULL) *error = [NSError git_errorFor:gitError description:@"Failed to create merge file input other side"];
return nil;
Expand Down
2 changes: 1 addition & 1 deletion ObjectiveGit/GTRepository+Pull.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

NS_ASSUME_NONNULL_BEGIN

typedef void (^GTRemoteFetchTransferProgressBlock)(const git_transfer_progress *progress, BOOL *stop);
typedef void (^GTRemoteFetchTransferProgressBlock)(const git_indexer_progress *progress, BOOL *stop);

@interface GTRepository (Pull)

Expand Down
2 changes: 1 addition & 1 deletion ObjectiveGit/GTRepository+RemoteOperations.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ typedef NS_ENUM(NSInteger, GTFetchPruneOption) {
///
/// Returns YES if the fetch was successful, NO otherwise (and `error`, if provided,
/// will point to an error describing what happened).
- (BOOL)fetchRemote:(GTRemote *)remote withOptions:(NSDictionary * _Nullable)options error:(NSError **)error progress:(void (^ _Nullable)(const git_transfer_progress *stats, BOOL *stop))progressBlock;
- (BOOL)fetchRemote:(GTRemote *)remote withOptions:(NSDictionary * _Nullable)options error:(NSError **)error progress:(void (^ _Nullable)(const git_indexer_progress *stats, BOOL *stop))progressBlock;

/// Enumerate all available fetch head entries.
///
Expand Down
6 changes: 3 additions & 3 deletions ObjectiveGit/GTRepository+RemoteOperations.m
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
NSString *const GTRepositoryRemoteOptionsDownloadTags = @"GTRepositoryRemoteOptionsDownloadTags";
NSString *const GTRepositoryRemoteOptionsPushNotes = @"GTRepositoryRemoteOptionsPushNotes";

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

@implementation GTRepository (RemoteOperations)
Expand All @@ -45,7 +45,7 @@ @implementation GTRepository (RemoteOperations)
git_direction direction;
} GTRemoteConnectionInfo;

int GTRemoteFetchTransferProgressCallback(const git_transfer_progress *stats, void *payload) {
int GTRemoteFetchTransferProgressCallback(const git_indexer_progress *stats, void *payload) {
GTRemoteConnectionInfo *info = payload;
BOOL stop = NO;

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

git_push_options push_options = GIT_PUSH_OPTIONS_INIT;

gitError = git_push_init_options(&push_options, GIT_PUSH_OPTIONS_VERSION);
gitError = git_push_options_init(&push_options, GIT_PUSH_OPTIONS_VERSION);
if (gitError != GIT_OK) {
if (error != NULL) *error = [NSError git_errorFor:gitError description:@"Failed to init push options"];
return NO;
Expand Down
6 changes: 3 additions & 3 deletions ObjectiveGit/GTRepository.m
Original file line number Diff line number Diff line change
Expand Up @@ -214,9 +214,9 @@ - (instancetype)initWithURL:(NSURL *)localFileURL flags:(NSInteger)flags ceiling
}


typedef void(^GTTransferProgressBlock)(const git_transfer_progress *progress, BOOL *stop);
typedef void(^GTTransferProgressBlock)(const git_indexer_progress *progress, BOOL *stop);

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

+ (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 {
+ (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 {

git_clone_options cloneOptions = GIT_CLONE_OPTIONS_INIT;

Expand Down
2 changes: 1 addition & 1 deletion ObjectiveGitTests/GTRemoteSpec.m
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@

__block unsigned int receivedObjects = 0;
__block BOOL transferProgressed = NO;
BOOL success = [fetchingRepo fetchRemote:remote withOptions:nil error:&error progress:^(const git_transfer_progress *stats, BOOL *stop) {
BOOL success = [fetchingRepo fetchRemote:remote withOptions:nil error:&error progress:^(const git_indexer_progress *stats, BOOL *stop) {
receivedObjects += stats->received_objects;
transferProgressed = YES;
}];
Expand Down
10 changes: 5 additions & 5 deletions ObjectiveGitTests/GTRepository+PullSpec.m
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@

// Pull
__block BOOL transferProgressed = NO;
BOOL result = [localRepo pullBranch:masterBranch fromRemote:remote withOptions:nil error:&error progress:^(const git_transfer_progress *progress, BOOL *stop) {
BOOL result = [localRepo pullBranch:masterBranch fromRemote:remote withOptions:nil error:&error progress:^(const git_indexer_progress *progress, BOOL *stop) {
transferProgressed = YES;
}];
expect(error).to(beNil());
Expand Down Expand Up @@ -124,7 +124,7 @@
// Pull
__block BOOL transferProgressed = NO;
BOOL result = [localRepo pullBranch:masterBranch fromRemote:remote withOptions:nil error:&error progress:^(const git_transfer_progress *progress, BOOL *stop) {
BOOL result = [localRepo pullBranch:masterBranch fromRemote:remote withOptions:nil error:&error progress:^(const git_indexer_progress *progress, BOOL *stop) {
transferProgressed = YES;
}];
expect(@(result)).to(beTruthy());
Expand Down Expand Up @@ -165,7 +165,7 @@

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

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

// Pull
__block BOOL transferProgressed = NO;
BOOL result = [localRepo pullBranch:masterBranch fromRemote:remote withOptions:nil error:&error progress:^(const git_transfer_progress *progress, BOOL *stop) {
BOOL result = [localRepo pullBranch:masterBranch fromRemote:remote withOptions:nil error:&error progress:^(const git_indexer_progress *progress, BOOL *stop) {
transferProgressed = YES;
}];
NSString *fileContents = [NSString stringWithContentsOfURL:[localRepo.fileURL URLByAppendingPathComponent:@"test.txt"] encoding:NSUTF8StringEncoding error:nil];
Expand Down
4 changes: 2 additions & 2 deletions ObjectiveGitTests/GTRepositorySpec.m
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
describe(@"+cloneFromURL:toWorkingDirectory:options:error:transferProgressBlock:checkoutProgressBlock:", ^{
__block BOOL transferProgressCalled = NO;
__block BOOL checkoutProgressCalled = NO;
__block void (^transferProgressBlock)(const git_transfer_progress *, BOOL *);
__block void (^transferProgressBlock)(const git_indexer_progress *, BOOL *);
__block void (^checkoutProgressBlock)(NSString *, NSUInteger, NSUInteger);
__block NSURL *originURL;
__block NSURL *workdirURL;
Expand All @@ -78,7 +78,7 @@
beforeEach(^{
transferProgressCalled = NO;
checkoutProgressCalled = NO;
transferProgressBlock = ^(const git_transfer_progress *progress, BOOL *stop) {
transferProgressBlock = ^(const git_indexer_progress *progress, BOOL *stop) {
transferProgressCalled = YES;
};
checkoutProgressBlock = ^(NSString *path, NSUInteger completedSteps, NSUInteger totalSteps) {
Expand Down

0 comments on commit e3fef5d

Please sign in to comment.