Skip to content

Fix bug where GTPushTransferProgressBlock is unused #508

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Aug 14, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion ObjectiveGit/GTRepository+RemoteOperations.m
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ - (BOOL)pushRefspecs:(NSArray *)refspecs toRemote:(GTRemote *)remote withOptions

git_remote_callbacks remote_callbacks = GIT_REMOTE_CALLBACKS_INIT;
remote_callbacks.credentials = (credProvider != nil ? GTCredentialAcquireCallback : NULL),
remote_callbacks.transfer_progress = GTRemoteFetchTransferProgressCallback,
remote_callbacks.push_transfer_progress = GTRemotePushTransferProgressCallback;
remote_callbacks.payload = &connectionInfo,

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

push_options.callbacks = remote_callbacks;

const git_strarray git_refspecs = refspecs.git_strarray;

gitError = git_remote_upload(remote.git_remote, &git_refspecs, &push_options);
Expand Down
4 changes: 2 additions & 2 deletions ObjectiveGitTests/GTRemotePushSpec.m
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@
}];
expect(error).to(beNil());
expect(@(result)).to(beTruthy());
expect(@(transferProgressed)).to(beFalsy()); // Local transport doesn't currently call progress callbacks
expect(@(transferProgressed)).to(beTruthy());

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

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