File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed
Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change 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
You can’t perform that action at this time.
0 commit comments