@@ -78,17 +78,11 @@ - (BOOL)fetchRemote:(GTRemote *)remote withOptions:(NSDictionary *)options error
7878 .payload = &connectionInfo,
7979 };
8080
81- git_fetch_options fetch_options;
82- int gitError = git_fetch_init_options (&fetch_options, GIT_FETCH_OPTIONS_VERSION);
83- if (gitError != GIT_OK) {
84- if (error != NULL ) *error = [NSError git_errorFor: gitError description: @" Failed to init fetch options" ];
85- return NO ;
86- }
87-
88- fetch_options.callbacks = remote_callbacks;
81+ git_fetch_options fetchOptions = GIT_FETCH_OPTIONS_INIT;
82+ fetchOptions.callbacks = remote_callbacks;
8983
9084 __block git_strarray refspecs;
91- gitError = git_remote_get_fetch_refspecs (&refspecs, remote.git_remote );
85+ int gitError = git_remote_get_fetch_refspecs (&refspecs, remote.git_remote );
9286 if (gitError != GIT_OK) {
9387 if (error != NULL ) *error = [NSError git_errorFor: gitError description: @" Failed to get fetch refspecs for remote" ];
9488 return NO ;
@@ -100,7 +94,7 @@ - (BOOL)fetchRemote:(GTRemote *)remote withOptions:(NSDictionary *)options error
10094
10195 NSString *reflog_message = [NSString stringWithFormat: @" fetching remote %@ " , remote.name];
10296
103- gitError = git_remote_fetch (remote.git_remote , &refspecs, &fetch_options , reflog_message.UTF8String );
97+ gitError = git_remote_fetch (remote.git_remote , &refspecs, &fetchOptions , reflog_message.UTF8String );
10498 if (gitError != GIT_OK) {
10599 if (error != NULL ) *error = [NSError git_errorFor: gitError description: @" Failed to fetch from remote" ];
106100 return NO ;
0 commit comments