Skip to content

Commit fc9e959

Browse files
author
David Catmull
committed
Add some nullables to methods & properties that can return nil
1 parent 7febb4f commit fc9e959

File tree

6 files changed

+9
-9
lines changed

6 files changed

+9
-9
lines changed

ObjectiveGit/GTCredential.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ NS_ASSUME_NONNULL_BEGIN
4646
/// type - the credential types allowed by the operation.
4747
/// URL - the URL the operation is authenticating against.
4848
/// userName - the user name provided by the operation. Can be nil, and might be ignored.
49-
- (GTCredential * _Nullable)credentialForType:(GTCredentialType)type URL:(NSString *)URL userName:(nullable NSString *)userName;
49+
- (GTCredential * _Nullable)credentialForType:(GTCredentialType)type URL:(nullable NSString *)URL userName:(nullable NSString *)userName;
5050
@end
5151

5252
/// The GTCredential class is used to provide authentication data.

ObjectiveGit/GTIndex.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ NS_ASSUME_NONNULL_BEGIN
6969
/// error - If not NULL, set to any error that occurs.
7070
///
7171
/// Returns the loaded index, or nil if an error occurred.
72-
+ (instancetype)indexWithFileURL:(NSURL *)fileURL repository:(GTRepository *)repository error:(NSError **)error;
72+
+ (nullable instancetype)indexWithFileURL:(NSURL *)fileURL repository:(GTRepository *)repository error:(NSError **)error;
7373

7474
- (instancetype)init NS_UNAVAILABLE;
7575

ObjectiveGit/GTOID.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ NS_ASSUME_NONNULL_BEGIN
1616
@interface GTOID : NSObject <NSCopying>
1717

1818
/// The SHA pointed to by the OID.
19-
@property (nonatomic, readonly, copy) NSString *SHA;
19+
@property (nonatomic, readonly, copy, nullable) NSString *SHA;
2020

2121
/// Is the OID all zero? This usually indicates that the object has not been
2222
/// inserted into the ODB yet.

ObjectiveGit/GTReference.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ NS_ASSUME_NONNULL_BEGIN
5252
@property (nonatomic, readonly, strong) GTRepository *repository;
5353
@property (nonatomic, readonly) GTReferenceType referenceType;
5454
@property (nonatomic, readonly) const git_oid *git_oid;
55-
@property (nonatomic, strong, readonly) GTOID *OID;
55+
@property (nonatomic, strong, readonly, nullable) GTOID *OID;
5656

5757
/// Whether this is a remote-tracking branch.
5858
@property (nonatomic, readonly, getter = isRemote) BOOL remote;
@@ -78,10 +78,10 @@ NS_ASSUME_NONNULL_BEGIN
7878
- (git_reference *)git_reference __attribute__((objc_returns_inner_pointer));
7979

8080
/// The target (either GTObject or GTReference) to which the reference points.
81-
@property (nonatomic, readonly, copy) id unresolvedTarget;
81+
@property (nonatomic, readonly, copy, nullable) id unresolvedTarget;
8282

8383
/// The resolved object to which the reference points.
84-
@property (nonatomic, readonly, copy) id resolvedTarget;
84+
@property (nonatomic, readonly, copy, nullable) id resolvedTarget;
8585

8686
/// The last direct reference in a chain
8787
@property (nonatomic, readonly, copy) GTReference *resolvedReference;

ObjectiveGit/GTRepository.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ typedef NS_ENUM(NSInteger, GTRepositoryStateType) {
167167
@interface GTRepository : NSObject
168168

169169
/// The file URL for the repository's working directory.
170-
@property (nonatomic, readonly, strong) NSURL *fileURL;
170+
@property (nonatomic, readonly, strong, nullable) NSURL *fileURL;
171171
/// The file URL for the repository's .git directory.
172172
@property (nonatomic, readonly, strong, nullable) NSURL *gitDirectoryURL;
173173

ObjectiveGit/GTSignature.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@ NS_ASSUME_NONNULL_BEGIN
4242
@property (nonatomic, readonly, copy, nullable) NSString *email;
4343

4444
/// The time when the action happened.
45-
@property (nonatomic, readonly, strong) NSDate *time;
45+
@property (nonatomic, readonly, strong, nullable) NSDate *time;
4646

4747
/// The time zone that `time` should be interpreted relative to.
48-
@property (nonatomic, readonly, copy) NSTimeZone *timeZone;
48+
@property (nonatomic, readonly, copy, nullable) NSTimeZone *timeZone;
4949

5050
/// Initializes the receiver with the given signature.
5151
///

0 commit comments

Comments
 (0)