Skip to content

Commit 3496bbf

Browse files
committed
Added -isMerge.
1 parent ed58afe commit 3496bbf

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

Classes/GTCommit.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@
4646
@property (nonatomic, readonly) NSTimeZone *commitTimeZone;
4747
@property (nonatomic, readonly) GTTree *tree;
4848

49+
/// Is this a merge commit?
50+
@property (nonatomic, readonly, assign, getter = isMerge) BOOL merge;
51+
4952
/// The underlying `git_object` as a `git_commit` object.
5053
- (git_commit *)git_commit __attribute__((objc_returns_inner_pointer));
5154

Classes/GTCommit.m

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,10 @@ - (GTTree *)tree {
108108
return (GTTree *)[GTObject objectWithObj:(git_object *)tree inRepository:self.repository];
109109
}
110110

111+
- (BOOL)isMerge {
112+
return git_commit_parentcount(self.git_commit) > 1;
113+
}
114+
111115
- (NSArray *)parents {
112116
unsigned numberOfParents = git_commit_parentcount(self.git_commit);
113117
NSMutableArray *parents = [NSMutableArray arrayWithCapacity:numberOfParents];

0 commit comments

Comments
 (0)