8000 Add Push by phatblat · Pull Request #419 · libgit2/objective-git · GitHub
[go: up one dir, main page]

Skip to content

Add Push #419

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 18 commits into from
Dec 8, 2014
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Add transfer progress blocks to push tests
Local transport doesn't currently call the progress callbacks
  • Loading branch information
Ben Chatelain committed Nov 18, 2014
commit 96b6365f879c23b8a496701ff22a579454148bfa
12 changes: 10 additions & 2 deletions ObjectiveGitTests/GTRemotePushSpec.m
401E
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,13 @@
it(@"pushes nothing when the branch on local and remote are in sync", ^{
NSError *error = nil;

BOOL result = [localRepo pushBranch:masterBranch toRemote:remote withOptions:nil error:&error progress:NULL];
__block BOOL transferProgressed = NO;
BOOL result = [localRepo pushBranch:masterBranch toRemote:remote withOptions:nil error:&error progress:^(unsigned int current, unsigned int total, size_t bytes, BOOL *stop) {
transferProgressed = YES;
}];
expect(error).to(beNil());
expect(@(result)).to(beTruthy());
expect(@(transferProgressed)).to(beFalse()); // Local transport doesn't currently call progress callbacks
});

it(@"pushes a new local commit to the remote", ^{
Expand All @@ -116,9 +120,13 @@
expect(testCommit).notTo(beNil());

// Push
BOOL result = [localRepo pushBranch:masterBranch toRemote:remote withOptions:nil error:&error progress:NULL];
__block BOOL transferProgressed = NO;
BOOL result = [localRepo pushBranch:masterBranch toRemote:remote withOptions:nil error:&error progress:^(unsigned int current, unsigned int total, size_t bytes, BOOL *stop) {
transferProgressed = YES;
}];
expect(error).to(beNil());
expect(@(result)).to(beTruthy());
expect(@(transferProgressed)).to(beFalse()); // Local transport doesn't currently call progress callbacks

// Verify commit is in remote
GTCommit *pushedCommit = [remoteRepo lookUpObjectByOID:testCommit.OID objectType:GTObjectTypeCommit error:&error];
Expand Down
0