Skip to content

Commit f86fc7e

Browse files
committed
Merge pull request #508 from dleehr/fix-push-progressblock
Fix bug where GTPushTransferProgressBlock is unused
2 parents f26c5c2 + a6f6c58 commit f86fc7e

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

ObjectiveGit/GTRepository+RemoteOperations.m

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ - (BOOL)pushRefspecs:(NSArray *)refspecs toRemote:(GTRemote *)remote withOptions
219219

220220
git_remote_callbacks remote_callbacks = GIT_REMOTE_CALLBACKS_INIT;
221221
remote_callbacks.credentials = (credProvider != nil ? GTCredentialAcquireCallback : NULL),
222-
remote_callbacks.transfer_progress = GTRemoteFetchTransferProgressCallback,
222+
remote_callbacks.push_transfer_progress = GTRemotePushTransferProgressCallback;
223223
remote_callbacks.payload = &connectionInfo,
224224

225225
gitError = git_remote_connect(remote.git_remote, GIT_DIRECTION_PUSH, &remote_callbacks);
@@ -239,6 +239,8 @@ - (BOOL)pushRefspecs:(NSArray *)refspecs toRemote:(GTRemote *)remote withOptions
239239
return NO;
240240
}
241241

242+
push_options.callbacks = remote_callbacks;
243+
242244
const git_strarray git_refspecs = refspecs.git_strarray;
243245

244246
gitError = git_remote_upload(remote.git_remote, &git_refspecs, &push_options);

ObjectiveGitTests/GTRemotePushSpec.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@
115115
}];
116116
expect(error).to(beNil());
117117
expect(@(result)).to(beTruthy());
118-
expect(@(transferProgressed)).to(beFalsy()); // Local transport doesn't currently call progress callbacks
118+
expect(@(transferProgressed)).to(beTruthy());
119119

120120
// Same number of commits after push, refresh branch first
121121
remoteMasterBranch = localBranchWithName(@"master", remoteRepo);
@@ -152,7 +152,7 @@
152152
}];
153153
expect(error).to(beNil());
154154
expect(@(result)).to(beTruthy());
155-
expect(@(transferProgressed)).to(beFalsy()); // Local transport doesn't currently call progress callbacks
155+
expect(@(transferProgressed)).to(beTruthy());
156156

157157
// Number of commits on tracking branch after push
158158
localTrackingBranch = [masterBranch trackingBranchWithError:&error success:&success];

0 commit comments

Comments
 (0)