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
5454@property (nonatomic , readonly ) const git_oid *git_oid;
5555@property (nonatomic , strong , readonly ) GTOID * _Nullable OID;
5656
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+
5763// / Whether this is a remote-tracking branch.
5864@property (nonatomic , readonly , getter = isRemote) BOOL remote;
5965
66+ // / Whether this is a note ref.
67+ @property (nonatomic , readonly , getter = isNote) BOOL note;
68+
6069// / The reflog for the reference.
6170@property (nonatomic , readonly , strong ) GTReflog *reflog;
6271
Original file line number Diff line number Diff line change @@ -105,6 +105,18 @@ - (instancetype)initWithGitReference:(git_reference *)ref repository:(GTReposito
105105 return self;
106106}
107107
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+
108120- (NSString *)name {
109121 const char *refName = git_reference_name (self.git_reference );
110122 if (refName == NULL ) return nil ;
You can’t perform that action at this time.
0 commit comments