Skip to content

Commit eb61458

Browse files
committed
Merge pull request octokit#51 from octokit/default-branch
Added defaultBranch to OCTRepository
2 parents a5884c6 + d7c9729 commit eb61458

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

OctoKit/OCTRepository.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,7 @@
4545
// The URL for visiting this repository on the web.
4646
@property (nonatomic, copy, readonly) NSURL *HTMLURL;
4747

48+
// The default branch's name. For empty repositories, this will be nil.
49+
@property (nonatomic, copy, readonly) NSString *defaultBranch;
50+
4851
@end

OctoKit/OCTRepository.m

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ + (NSDictionary *)JSONKeyPathsByPropertyKey {
2222
@"ownerLogin": @"owner.login",
2323
@"datePushed": @"pushed_at",
2424
@"repoDescription": @"description",
25+
@"defaultBranch": @"default_branch",
2526
}];
2627
}
2728

OctoKitTests/OCTRepositorySpec.m

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@
4747
@"open_issues": @0,
4848
@"pushed_at": @"2011-01-26T19:06:43Z",
4949
@"created_at": @"2011-01-26T19:01:12Z",
50-
@"updated_at": @"2011-01-26T19:14:43Z"
50+
@"updated_at": @"2011-01-26T19:14:43Z",
51+
@"default_branch": @"master",
5152
};
5253

5354
__block OCTRepository *repository;
@@ -75,6 +76,7 @@
7576
expect(repository.HTTPSURL).to.equal([NSURL URLWithString:@"https://github.com/octocat/Hello-World.git"]);
7677
expect(repository.HTMLURL).to.equal([NSURL URLWithString:@"https://github.com/octocat/Hello-World"]);
7778
expect(repository.SSHURL).to.equal(@"[email protected]:octocat/Hello-World.git");
79+
expect(repository.defaultBranch).to.equal(@"master");
7880
});
7981
});
8082

0 commit comments

Comments
 (0)