Skip to content

Commit 3820877

Browse files
committed
😢
1 parent 4496405 commit 3820877

File tree

2 files changed

+12
-13
lines changed

2 files changed

+12
-13
lines changed

ObjectiveGit/GTRepository+RemoteOperations.m

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121

2222
#import "git2/errors.h"
2323
#import "git2/remote.h"
24-
#import "git2/push.h"
2524

2625
NSString *const GTRepositoryRemoteOptionsCredentialProvider = @"GTRepositoryRemoteOptionsCredentialProvider";
2726

@@ -66,6 +65,7 @@ int GTRemotePushTransferProgressCallback(unsigned int current, unsigned int tota
6665
#pragma mark Fetch
6766

6867
- (BOOL)fetchRemote:(GTRemote *)remote withOptions:(NSDictionary *)options error:(NSError **)error progress:(GTRemoteFetchTransferProgressBlock)progressBlock {
68+
#if 0
6969
GTCredentialProvider *credProvider = options[GTRepositoryRemoteOptionsCredentialProvider];
7070
GTRemoteConnectionInfo connectionInfo = {
7171
.credProvider = {credProvider},
@@ -101,6 +101,7 @@ - (BOOL)fetchRemote:(GTRemote *)remote withOptions:(NSDictionary *)options error
101101
if (error != NULL) *error = [NSError git_errorFor:gitError description:@"Failed to fetch from remote"];
102102
return NO;
103103
}
104+
#endif
104105

105106
return YES;
106107
}
@@ -210,6 +211,7 @@ - (BOOL)deleteBranch:(GTBranch *)branch fromRemote:(GTRemote *)remote withOption
210211
#pragma mark - Push (Private)
211212

212213
- (BOOL)pushRefspecs:(NSArray *)refspecs toRemote:(GTRemote *)remote withOptions:(NSDictionary *)options error:(NSError **)error progress:(GTRemotePushTransferProgressBlock)progressBlock {
214+
#if 0
213215
int gitError;
214216
GTCredentialProvider *credProvider = options[GTRepositoryRemoteOptionsCredentialProvider];
215217

@@ -262,6 +264,7 @@ - (BOOL)pushRefspecs:(NSArray *)refspecs toRemote:(GTRemote *)remote withOptions
262264
if (error != NULL) *error = [NSError git_errorFor:gitError description:@"Update tips failed"];
263265
return NO;
264266
}
267+
#endif
265268

266269
return YES;
267270
}

ObjectiveGit/GTRepository.m

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,8 @@ static void checkoutProgressCallback(const char *path, size_t completedSteps, si
194194
block(nsPath, completedSteps, totalSteps);
195195
}
196196

197+
#if 0
198+
197199
static int transferProgressCallback(const git_transfer_progress *progress, void *payload) {
198200
if (payload == NULL) return 0;
199201
struct GTClonePayload *pld = payload;
@@ -212,21 +214,16 @@ static int transferProgressCallback(const git_transfer_progress *progress, void
212214
static int remoteCreate(git_remote **remote, git_repository *repo, const char *name, const char *url, void *payload)
213215
{
214216
int error;
215-
struct GTRemoteCreatePayload *pld = payload;
216-
git_remote_callbacks *callbacks = &pld->remoteCallbacks;
217-
218217
if ((error = git_remote_create(remote, repo, name, url)) < 0)
219218
return error;
220219

221-
return git_remote_set_callbacks(*remote, callbacks);
220+
return GIT_OK;
222221
}
223222

224-
struct GTRemoteCreatePayload {
225-
git_remote_callbacks remoteCallbacks;
226-
};
223+
#endif
227224

228225
+ (instancetype)cloneFromURL:(NSURL *)originURL toWorkingDirectory:(NSURL *)workdirURL options:(NSDictionary *)options error:(NSError **)error transferProgressBlock:(void (^)(const git_transfer_progress *, BOOL *stop))transferProgressBlock checkoutProgressBlock:(void (^)(NSString *path, NSUInteger completedSteps, NSUInteger totalSteps))checkoutProgressBlock {
229-
226+
#if 0
230227
git_clone_options cloneOptions = GIT_CLONE_OPTIONS_INIT;
231228

232229
NSNumber *bare = options[GTRepositoryCloneOptionsBare];
@@ -259,11 +256,7 @@ + (instancetype)cloneFromURL:(NSURL *)originURL toWorkingDirectory:(NSURL *)work
259256
cloneOptions.remote_callbacks.transfer_progress = transferProgressCallback;
260257
cloneOptions.remote_callbacks.payload = &payload;
261258

262-
struct GTRemoteCreatePayload remoteCreatePayload;
263-
remoteCreatePayload.remoteCallbacks = cloneOptions.remote_callbacks;
264-
265259
cloneOptions.remote_cb = remoteCreate;
266-
cloneOptions.remote_cb_payload = &remoteCreatePayload;
267260

268261
BOOL localClone = [options[GTRepositoryCloneOptionsCloneLocal] boolValue];
269262
if (localClone) {
@@ -295,6 +288,9 @@ + (instancetype)cloneFromURL:(NSURL *)originURL toWorkingDirectory:(NSURL *)work
295288
}
296289

297290
return [[self alloc] initWithGitRepository:repository];
291+
#endif
292+
293+
return nil;
298294
}
299295

300296
- (id)lookUpObjectByGitOid:(const git_oid *)oid objectType:(GTObjectType)type error:(NSError **)error {

0 commit comments

Comments
 (0)