Skip to content

Commit 4a00e48

Browse files
author
Ben Chatelain
committed
GTReflog nullability
1 parent 562f0d7 commit 4a00e48

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

ObjectiveGit/GTReflog+Private.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@
1717
/// reference - The reference whose reflog is being represented. Cannot be nil.
1818
///
1919
/// Returns the initialized object.
20-
- (id)initWithReference:(GTReference *)reference NS_DESIGNATED_INITIALIZER;
20+
- (nullable instancetype)initWithReference:(GTReference *)reference NS_DESIGNATED_INITIALIZER;
2121

2222
@end

ObjectiveGit/GTReflog.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
@class GTSignature;
1212
@class GTReflogEntry;
1313

14+
NS_ASSUME_NONNULL_BEGIN
15+
1416
/// A reflog for a reference. Reflogs should not be created manually. Use
1517
/// -[GTReference reflog] to get the reflog for a reference.
1618
@interface GTReflog : NSObject
@@ -32,7 +34,9 @@
3234
/// index - The reflog entry to get. 0 is the most recent entry. If it is greater
3335
/// than `entryCount`, it will assert.
3436
///
35-
/// Returns the entry at that index.
36-
- (GTReflogEntry *)entryAtIndex:(NSUInteger)index;
37+
/// Returns the entry at that index or nil if not found.
38+
- (nullable GTReflogEntry *)entryAtIndex:(NSUInteger)index;
3739

3840
@end
41+
42+
NS_ASSUME_NONNULL_END

ObjectiveGit/GTReflog.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ - (void)dealloc {
3333
if (_git_reflog != NULL) git_reflog_free(_git_reflog);
3434
}
3535

36-
- (id)initWithReference:(GTReference *)reference {
36+
- (instancetype)initWithReference:(GTReference *)reference {
3737
NSParameterAssert(reference != nil);
3838
NSParameterAssert(reference.name != nil);
3939

0 commit comments

Comments
 (0)