Skip to content

Commit 8da6daf

Browse files
author
Ben Chatelain
committed
Add example of pushing two branches
1 parent 307936c commit 8da6daf

File tree

1 file changed

+4
-13
lines changed

1 file changed

+4
-13
lines changed

ObjectiveGitTests/GTRemotePushSpec.m

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -165,22 +165,13 @@
165165
expect(fileData.content).to(equal(testData));
166166
});
167167

168-
pending(@"can push two branches", ^{
169-
GTBranch *masterBranch = localBranchWithName(@"master", localRepo);
170-
GTBranch *remoteMasterBranch = localBranchWithName(@"master", remoteRepo);
171-
expect(@([remoteMasterBranch numberOfCommitsWithError:NULL])).to(equal(@3));
168+
it(@"can push two branches", ^{
169+
GTBranch *branch1 = localBranchWithName(@"master", localRepo);
170+
GTBranch *branch2 = localBranchWithName(@"packed", remoteRepo);
172171

173-
// Push
174-
__block BOOL transferProgressed = NO;
175-
BOOL result = [localRepo pushBranch:masterBranch toRemote:remote withOptions:nil error:&error progress:^(unsigned int current, unsigned int total, size_t bytes, BOOL *stop) {
176-
transferProgressed = YES;
177-
}];
172+
BOOL result = [localRepo pushBranches:@[ branch1, branch2 ] toRemote:remote withOptions:nil error:&error progress:NULL];
178173
expect(error).to(beNil());
179174
expect(@(result)).to(beTruthy());
180-
expect(@(transferProgressed)).to(beFalse()); // Local transport doesn't currently call progress callbacks
181-
182-
// Same number of commits after push
183-
expect(@([remoteMasterBranch numberOfCommitsWithError:NULL])).to(equal(@3));
184175
});
185176
});
186177

0 commit comments

Comments
 (0)