Skip to content

Commit b0de976

Browse files
committed
Updated Branch Spec Test
1 parent 81dbdfc commit b0de976

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

ObjectiveGitTests/GTBranchSpec.m

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,37 @@
228228
expect(trackingBranch).to(beNil());
229229
expect(@(success)).to(beTruthy());
230230
});
231+
232+
it(@"should set a remote tracking branch without branches amount change", ^{
233+
GTRepository *repository = self.testAppForkFixtureRepository;
234+
expect(repository).notTo(beNil());
235+
236+
NSError *error = nil;
237+
BOOL success = NO;
238+
GTBranch *remoteBranch = [repository lookUpBranchWithName:@"github/BranchC" type:GTBranchTypeRemote success:&success error:&error];
239+
expect(remoteBranch).notTo(beNil());
240+
expect(error).to(beNil());
241+
242+
NSArray *beforeBranches = [repository branches:&error];
243+
expect(error).to(beNil());
244+
245+
GTBranch *localBranch = [repository createBranchNamed:remoteBranch.shortName fromOID:remoteBranch.OID message:nil error:&error];
246+
expect(localBranch).notTo(beNil());
247+
expect(error).to(beNil());
248+
249+
NSArray *inBranches = [repository branches:&error];
250+
expect(error).to(beNil());
251+
252+
[localBranch updateTrackingBranch:remoteBranch error:&error];
253+
expect(error).to(beNil());
254+
255+
NSArray *afterBranches = [repository branches:&error];
256+
expect(error).to(beNil());
257+
258+
expect(@(beforeBranches.count + 1)).to(equal(@(inBranches.count)));
259+
expect(@(beforeBranches.count)).to(equal(@(afterBranches.count)));
260+
261+
});
231262
});
232263

233264
// TODO: Test branch renaming, branch upstream

0 commit comments

Comments
 (0)