Skip to content

Commit 562f0d7

Browse files
author
Ben Chatelain
committed
GTBlameHunk nullability
1 parent f69ac1e commit 562f0d7

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

ObjectiveGit/GTBlameHunk.h

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,27 @@
1212
@class GTOID;
1313
@class GTSignature;
1414

15+
NS_ASSUME_NONNULL_BEGIN
16+
1517
/// A `GTBlameHunk` is an object that provides authorship info for a set of lines in a `GTBlame`.
1618
@interface GTBlameHunk : NSObject
1719

1820
/// Designated initializer.
19-
- (instancetype)initWithGitBlameHunk:(git_blame_hunk)hunk NS_DESIGNATED_INITIALIZER;
21+
///
22+
/// hunk - A git_blame_hunk to wrap. May not be NULL.
23+
///
24+
/// Returns a blame hunk, or nil if initialization failed.
25+
- (nullable instancetype)initWithGitBlameHunk:(git_blame_hunk)hunk NS_DESIGNATED_INITIALIZER;
2026

2127
/// A NSRange where `location` is the (1 based) starting line number,
2228
/// and `length` is the number of lines in the hunk.
2329
@property (nonatomic, readonly) NSRange lines;
2430

2531
/// The OID of the commit where this hunk was last changed.
26-
@property (nonatomic, readonly, copy) GTOID *finalCommitOID;
32+
@property (nonatomic, readonly, copy, nullable) GTOID *finalCommitOID;
2733

2834
/// The signature of the commit where this hunk was last changed.
29-
@property (nonatomic, readonly) GTSignature *finalSignature;
35+
@property (nonatomic, readonly, nullable) GTSignature *finalSignature;
3036

3137
/// The path of the file in the original commit.
3238
@property (nonatomic, readonly, copy) NSString *originalPath;
@@ -39,3 +45,5 @@
3945
@property (nonatomic, readonly) git_blame_hunk git_blame_hunk;
4046

4147
@end
48+
49+
NS_ASSUME_NONNULL_END

0 commit comments

Comments
 (0)