File tree Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -54,9 +54,18 @@ NS_ASSUME_NONNULL_BEGIN
54
54
@property (nonatomic , readonly ) const git_oid *git_oid;
55
55
@property (nonatomic , strong , readonly ) GTOID * _Nullable OID;
56
56
57
+ // / Whether this is a tag.
58
+ @property (nonatomic , readonly , getter = isTag) BOOL tag;
59
+
60
+ // / Whether this is a local branch.
61
+ @property (nonatomic , readonly , getter = isBranch) BOOL branch;
62
+
57
63
// / Whether this is a remote-tracking branch.
58
64
@property (nonatomic , readonly , getter = isRemote) BOOL remote;
59
65
66
+ // / Whether this is a note ref.
67
+ @property (nonatomic , readonly , getter = isNote) BOOL note;
68
+
60
69
// / The reflog for the reference.
61
70
@property (nonatomic , readonly , strong ) GTReflog *reflog;
62
71
Original file line number Diff line number Diff line change @@ -105,6 +105,18 @@ - (instancetype)initWithGitReference:(git_reference *)ref repository:(GTReposito
105
105
return self;
106
106
}
107
107
108
+ - (BOOL )isBranch {
109
+ return git_reference_is_branch (self.git_reference ) != 0 ;
110
+ }
111
+
112
+ - (BOOL )isTag {
113
+ return git_reference_is_tag (self.git_reference ) != 0 ;
114
+ }
115
+
116
+ - (BOOL )isNote {
117
+ return git_reference_is_note (self.git_reference ) != 0 ;
118
+ }
119
+
108
120
- (NSString *)name {
109
121
const char *refName = git_reference_name (self.git_reference );
110
122
if (refName == NULL ) return nil ;
You can’t perform that action at this time.
0 commit comments