diff --git a/ObjectiveGit/GTBlame.h b/ObjectiveGit/GTBlame.h index 22668133d..12db9a5c2 100644 --- a/ObjectiveGit/GTBlame.h +++ b/ObjectiveGit/GTBlame.h @@ -24,7 +24,7 @@ NS_ASSUME_NONNULL_BEGIN /// blame - A git_blame to wrap. May not be NULL. /// /// Returns a blame, or nil if initialization failed. -- (nullable instancetype)initWithGitBlame:(git_blame *)blame NS_DESIGNATED_INITIALIZER; +- (instancetype _Nullable)initWithGitBlame:(git_blame *)blame NS_DESIGNATED_INITIALIZER; /// Get all the hunks in the blame. A convenience wrapper around `enumerateHunksUsingBlock:` @property (nonatomic, strong, readonly) NSArray *hunks; @@ -37,7 +37,7 @@ NS_ASSUME_NONNULL_BEGIN /// index - The index to retrieve the hunk from. /// /// Returns a `GTBlameHunk` or nil if an error occurred. -- (nullable GTBlameHunk *)hunkAtIndex:(NSUInteger)index; +- (GTBlameHunk * _Nullable)hunkAtIndex:(NSUInteger)index; /// Enumerate the hunks in the blame. /// @@ -52,7 +52,7 @@ NS_ASSUME_NONNULL_BEGIN /// lineNumber - The (1 based) line number to find a hunk for. /// /// Returns a `GTBlameHunk` or nil if an error occurred. -- (nullable GTBlameHunk *)hunkAtLineNumber:(NSUInteger)lineNumber; +- (GTBlameHunk * _Nullable)hunkAtLineNumber:(NSUInteger)lineNumber; /// The underlying `git_blame` object. - (git_blame *)git_blame __attribute__((objc_returns_inner_pointer)); diff --git a/ObjectiveGit/GTBlameHunk.h b/ObjectiveGit/GTBlameHunk.h index 9e16c7850..72e3f1764 100644 --- a/ObjectiveGit/GTBlameHunk.h +++ b/ObjectiveGit/GTBlameHunk.h @@ -24,17 +24,17 @@ NS_ASSUME_NONNULL_BEGIN /// hunk - A git_blame_hunk to wrap. May not be NULL. /// /// Returns a blame hunk, or nil if initialization failed. -- (nullable instancetype)initWithGitBlameHunk:(git_blame_hunk)hunk NS_DESIGNATED_INITIALIZER; +- (instancetype _Nullable)initWithGitBlameHunk:(git_blame_hunk)hunk NS_DESIGNATED_INITIALIZER; /// A NSRange where `location` is the (1 based) starting line number, /// and `length` is the number of lines in the hunk. @property (nonatomic, readonly) NSRange lines; /// The OID of the commit where this hunk was last changed. -@property (nonatomic, readonly, copy, nullable) GTOID *finalCommitOID; +@property (nonatomic, readonly, copy) GTOID * _Nullable finalCommitOID; /// The signature of the commit where this hunk was last changed. -@property (nonatomic, readonly, nullable) GTSignature *finalSignature; +@property (nonatomic, readonly) GTSignature * _Nullable finalSignature; /// The path of the file in the original commit. @property (nonatomic, readonly, copy) NSString *originalPath; diff --git a/ObjectiveGit/GTBlob.h b/ObjectiveGit/GTBlob.h index 25910c296..5ab16a990 100644 --- a/ObjectiveGit/GTBlob.h +++ b/ObjectiveGit/GTBlob.h @@ -43,7 +43,7 @@ NS_ASSUME_NONNULL_BEGIN /// error - Will be set if an error occurs. This may be nil. /// /// Return a newly created blob object, or nil if an error occurs. -+ (nullable instancetype)blobWithString:(NSString *)string inRepository:(GTRepository *)repository error:(NSError **)error; ++ (instancetype _Nullable)blobWithString:(NSString *)string inRepository:(GTRepository *)repository error:(NSError **)error; /// Creates a new blob from the given data. /// @@ -54,7 +54,7 @@ NS_ASSUME_NONNULL_BEGIN /// error - Will be set if an error occurs. This may be nil. /// /// Return a newly created blob object, or nil if an error occurs. -+ (nullable instancetype)blobWithData:(NSData *)data inRepository:(GTRepository *)repository error:(NSError **)error; ++ (instancetype _Nullable)blobWithData:(NSData *)data inRepository:(GTRepository *)repository error:(NSError **)error; /// Creates a new blob given an NSURL to a file. /// @@ -65,7 +65,7 @@ NS_ASSUME_NONNULL_BEGIN /// error - Will be set if an error occurs. This may be nil. /// /// Return a newly created blob object, or nil if an error occurs. -+ (nullable instancetype)blobWithFile:(NSURL *)file inRepository:(GTRepository *)repository error:(NSError **)error; ++ (instancetype _Nullable)blobWithFile:(NSURL *)file inRepository:(GTRepository *)repository error:(NSError **)error; /// Creates a new blob from the given string. /// @@ -76,7 +76,7 @@ NS_ASSUME_NONNULL_BEGIN /// error - Will be set if an error occurs. This may be nil. /// /// Return a newly created blob object, or nil if an error occurs. -- (nullable instancetype)initWithString:(NSString *)string inRepository:(GTRepository *)repository error:(NSError **)error; +- (instancetype _Nullable)initWithString:(NSString *)string inRepository:(GTRepository *)repository error:(NSError **)error; /// Creates a new blob from the passed data. /// @@ -87,7 +87,7 @@ NS_ASSUME_NONNULL_BEGIN /// error - Will be set if an error occurs. This may be nil. /// /// Returns a newly created blob object, or nil if an error occurs. -- (nullable instancetype)initWithData:(NSData *)data inRepository:(GTRepository *)repository error:(NSError **)error; +- (instancetype _Nullable)initWithData:(NSData *)data inRepository:(GTRepository *)repository error:(NSError **)error; /// Creates a new blob from the specified file. /// @@ -98,14 +98,14 @@ NS_ASSUME_NONNULL_BEGIN /// error - Will be set if an error occurs. This may be nil. /// /// Returns a newly created blob object, or nil if an error occurs. -- (nullable instancetype)initWithFile:(NSURL *)file inRepository:(GTRepository *)repository error:(NSError **)error; +- (instancetype _Nullable)initWithFile:(NSURL *)file inRepository:(GTRepository *)repository error:(NSError **)error; /// The underlying `git_object` as a `git_blob` object. - (git_blob *)git_blob __attribute__((objc_returns_inner_pointer)); - (git_off_t)size; - (NSString *)content; -- (nullable NSData *)data; +- (NSData * _Nullable)data; /// Attempts to apply the filter list for `path` to the blob. /// @@ -113,7 +113,7 @@ NS_ASSUME_NONNULL_BEGIN /// error - If not NULL, set to any error that occurs. /// /// Returns the filtered data, or nil if an error occurs. -- (nullable NSData *)applyFiltersForPath:(NSString *)path error:(NSError **)error; +- (NSData * _Nullable)applyFiltersForPath:(NSString *)path error:(NSError **)error; @end diff --git a/ObjectiveGit/GTBranch.h b/ObjectiveGit/GTBranch.h index 4a8766357..d53977643 100644 --- a/ObjectiveGit/GTBranch.h +++ b/ObjectiveGit/GTBranch.h @@ -43,10 +43,10 @@ NS_ASSUME_NONNULL_BEGIN /// equal. @interface GTBranch : NSObject -@property (nonatomic, readonly, nullable) NSString *name; -@property (nonatomic, readonly, nullable) NSString *shortName; -@property (nonatomic, copy, readonly, nullable) GTOID *OID; -@property (nonatomic, readonly, nullable) NSString *remoteName; +@property (nonatomic, readonly) NSString * _Nullable name; +@property (nonatomic, readonly) NSString * _Nullable shortName; +@property (nonatomic, copy, readonly) GTOID * _Nullable OID; +@property (nonatomic, readonly) NSString * _Nullable remoteName; @property (nonatomic, readonly) GTBranchType branchType; @property (nonatomic, readonly, strong) GTRepository *repository; @property (nonatomic, readonly, strong) GTReference *reference; @@ -62,7 +62,7 @@ NS_ASSUME_NONNULL_BEGIN /// repo - The repository containing the branch. Must not be nil. /// /// Returns the initialized receiver. -- (nullable instancetype)initWithReference:(GTReference *)ref repository:(GTRepository *)repo NS_DESIGNATED_INITIALIZER; +- (instancetype _Nullable)initWithReference:(GTReference *)ref repository:(GTRepository *)repo NS_DESIGNATED_INITIALIZER; /// Convenience class initializer. /// @@ -70,14 +70,14 @@ NS_ASSUME_NONNULL_BEGIN /// repo - The repository containing the branch. Must not be nil. /// /// Returns an initialized instance. -+ (nullable instancetype)branchWithReference:(GTReference *)ref repository:(GTRepository *)repo; ++ (instancetype _Nullable)branchWithReference:(GTReference *)ref repository:(GTRepository *)repo; /// Get the target commit for this branch /// /// error(out) - will be filled if an error occurs /// /// returns a GTCommit object or nil if an error occurred -- (nullable GTCommit *)targetCommitWithError:(NSError **)error; +- (GTCommit * _Nullable)targetCommitWithError:(NSError **)error; /// Count all commits in this branch /// @@ -92,7 +92,7 @@ NS_ASSUME_NONNULL_BEGIN /// error - If not NULL, set to any error that occurs. /// /// Returns a (possibly empty) array of GTCommits, or nil if an error occurs. -- (nullable NSArray *)uniqueCommitsRelativeToBranch:(GTBranch *)otherBranch error:(NSError **)error; +- (NSArray * _Nullable)uniqueCommitsRelativeToBranch:(GTBranch *)otherBranch error:(NSError **)error; /// Deletes the local branch and nils out the reference. - (BOOL)deleteWithError:(NSError **)error; @@ -100,7 +100,7 @@ NS_ASSUME_NONNULL_BEGIN /// If the receiver is a local branch, looks up and returns its tracking branch. /// If the receiver is a remote branch, returns self. If no tracking branch was /// found, returns nil and sets `success` to YES. -- (nullable GTBranch *)trackingBranchWithError:(NSError **)error success:(nullable BOOL *)success; +- (GTBranch * _Nullable)trackingBranchWithError:(NSError **)error success:(BOOL * _Nullable)success; /// Update the tracking branch. /// @@ -109,7 +109,7 @@ NS_ASSUME_NONNULL_BEGIN /// error - The error if one occurred. /// /// Returns whether it was successful. -- (BOOL)updateTrackingBranch:(nullable GTBranch *)trackingBranch error:(NSError **)error; +- (BOOL)updateTrackingBranch:(GTBranch * _Nullable)trackingBranch error:(NSError **)error; /// Reloads the branch's reference and creates a new branch based off that newly /// loaded reference. @@ -119,7 +119,7 @@ NS_ASSUME_NONNULL_BEGIN /// error - The error if one occurred. /// /// Returns the reloaded branch, or nil if an error occurred. -- (nullable GTBranch *)reloadedBranchWithError:(NSError **)error; +- (GTBranch * _Nullable)reloadedBranchWithError:(NSError **)error; /// Calculate the ahead/behind count from this branch to the given branch. /// diff --git a/ObjectiveGit/GTBranch.m b/ObjectiveGit/GTBranch.m index 9567a9874..eb42f3356 100644 --- a/ObjectiveGit/GTBranch.m +++ b/ObjectiveGit/GTBranch.m @@ -65,7 +65,7 @@ + (NSString *)remoteNamePrefix { return @"refs/remotes/"; } -+ (nullable instancetype)branchWithReference:(GTReference *)ref repository:(GTRepository *)repo { ++ (instancetype)branchWithReference:(GTReference *)ref repository:(GTRepository *)repo { return [[self alloc] initWithReference:ref repository:repo]; } @@ -74,7 +74,7 @@ - (instancetype)init { return nil; } -- (nullable instancetype)initWithReference:(GTReference *)ref repository:(GTRepository *)repo { +- (instancetype)initWithReference:(GTReference *)ref repository:(GTRepository *)repo { NSParameterAssert(ref != nil); NSParameterAssert(repo != nil); diff --git a/ObjectiveGit/GTCheckoutOptions.h b/ObjectiveGit/GTCheckoutOptions.h index ae3897e03..386838376 100644 --- a/ObjectiveGit/GTCheckoutOptions.h +++ b/ObjectiveGit/GTCheckoutOptions.h @@ -64,7 +64,7 @@ typedef NS_OPTIONS(NSInteger, GTCheckoutNotifyFlags) { /// @param notifyBlock A block that will be called for each event, @see `notifyFlags`. /// /// @return A newly-initialized GTCheckoutOptions object. -+ (instancetype)checkoutOptionsWithStrategy:(GTCheckoutStrategyType)strategy notifyFlags:(GTCheckoutNotifyFlags)notifyFlags progressBlock:(nullable void (^)(NSString *path, NSUInteger completedSteps, NSUInteger totalSteps))progressBlock notifyBlock:(nullable int (^)(GTCheckoutNotifyFlags why, NSString *path, GTDiffFile *baseline, GTDiffFile *target, GTDiffFile *workdir))notifyBlock; ++ (instancetype)checkoutOptionsWithStrategy:(GTCheckoutStrategyType)strategy notifyFlags:(GTCheckoutNotifyFlags)notifyFlags progressBlock:(void (^ _Nullable)(NSString *path, NSUInteger completedSteps, NSUInteger totalSteps))progressBlock notifyBlock:(int (^ _Nullable)(GTCheckoutNotifyFlags why, NSString *path, GTDiffFile *baseline, GTDiffFile *target, GTDiffFile *workdir))notifyBlock; /// Create a checkout options object. /// @see +checkoutOptionsWithStrategy:notifyFlags:progressBlock:notifyBlock: diff --git a/ObjectiveGit/GTCheckoutOptions.m b/ObjectiveGit/GTCheckoutOptions.m index f4c18ed5e..354e330c6 100644 --- a/ObjectiveGit/GTCheckoutOptions.m +++ b/ObjectiveGit/GTCheckoutOptions.m @@ -16,7 +16,7 @@ typedef void (^GTCheckoutProgressBlock)(NSString *path, NSUInteger completedSteps, NSUInteger totalSteps); // The type of block set in notifyBlock for notification reporting -typedef int (^GTCheckoutNotifyBlock)(GTCheckoutNotifyFlags why, NSString *path, GTDiffFile * __nullable baseline, GTDiffFile * __nullable target, GTDiffFile * __nullable workdir); +typedef int (^GTCheckoutNotifyBlock)(GTCheckoutNotifyFlags why, NSString *path, GTDiffFile * _Nullable baseline, GTDiffFile * _Nullable target, GTDiffFile * _Nullable workdir); @interface GTCheckoutOptions () { @@ -26,7 +26,7 @@ @interface GTCheckoutOptions () { @implementation GTCheckoutOptions -+ (instancetype)checkoutOptionsWithStrategy:(GTCheckoutStrategyType)strategy notifyFlags:(GTCheckoutNotifyFlags)notifyFlags progressBlock:(nullable GTCheckoutProgressBlock)progressBlock notifyBlock:(nullable GTCheckoutNotifyBlock)notifyBlock { ++ (instancetype)checkoutOptionsWithStrategy:(GTCheckoutStrategyType)strategy notifyFlags:(GTCheckoutNotifyFlags)notifyFlags progressBlock:(GTCheckoutProgressBlock _Nullable)progressBlock notifyBlock:( GTCheckoutNotifyBlock _Nullable)notifyBlock { GTCheckoutOptions *options = [self checkoutOptionsWithStrategy:strategy]; options.notifyFlags = notifyFlags; options.notifyBlock = notifyBlock; diff --git a/ObjectiveGit/GTCommit.h b/ObjectiveGit/GTCommit.h index cf4bc0373..af84a0e4f 100644 --- a/ObjectiveGit/GTCommit.h +++ b/ObjectiveGit/GTCommit.h @@ -39,15 +39,15 @@ NS_ASSUME_NONNULL_BEGIN @interface GTCommit : GTObject {} -@property (nonatomic, readonly, strong, nullable) GTSignature *author; -@property (nonatomic, readonly, strong, nullable) GTSignature *committer; +@property (nonatomic, readonly, strong) GTSignature * _Nullable author; +@property (nonatomic, readonly, strong) GTSignature * _Nullable committer; @property (nonatomic, readonly, copy) NSArray *parents; -@property (nonatomic, readonly, nullable) NSString *message; +@property (nonatomic, readonly) NSString * _Nullable message; @property (nonatomic, readonly) NSString *messageDetails; @property (nonatomic, readonly) NSString *messageSummary; @property (nonatomic, readonly) NSDate *commitDate; @property (nonatomic, readonly) NSTimeZone *commitTimeZone; -@property (nonatomic, readonly, nullable) GTTree *tree; +@property (nonatomic, readonly) GTTree * _Nullable tree; /// Is this a merge commit? @property (nonatomic, readonly, assign, getter = isMerge) BOOL merge; @@ -64,7 +64,7 @@ NS_ASSUME_NONNULL_BEGIN /// /// Returns an index which represents the result of the merge, or nil if an error /// occurred. -- (nullable GTIndex *)merge:(GTCommit *)otherCommit error:(NSError **)error; +- (GTIndex * _Nullable)merge:(GTCommit *)otherCommit error:(NSError **)error; @end diff --git a/ObjectiveGit/GTConfiguration+Private.h b/ObjectiveGit/GTConfiguration+Private.h index efd0598ec..03b6f4f12 100644 --- a/ObjectiveGit/GTConfiguration+Private.h +++ b/ObjectiveGit/GTConfiguration+Private.h @@ -18,6 +18,6 @@ /// repository - The repository in which the config resides. May be nil. /// /// Returns the initialized object. -- (nullable instancetype)initWithGitConfig:(nonnull git_config *)config repository:(nullable GTRepository *)repository NS_DESIGNATED_INITIALIZER; +- (instancetype _Nullable)initWithGitConfig:(git_config * _Nonnull)config repository:(GTRepository * _Nullable)repository NS_DESIGNATED_INITIALIZER; @end diff --git a/ObjectiveGit/GTConfiguration.h b/ObjectiveGit/GTConfiguration.h index 1e67030c1..6c4df90a4 100644 --- a/ObjectiveGit/GTConfiguration.h +++ b/ObjectiveGit/GTConfiguration.h @@ -17,24 +17,24 @@ NS_ASSUME_NONNULL_BEGIN @interface GTConfiguration : NSObject -@property (nonatomic, readonly, strong, nullable) GTRepository *repository; +@property (nonatomic, readonly, strong) GTRepository * _Nullable repository; @property (nonatomic, readonly, copy) NSArray *configurationKeys; /// The GTRemotes in the config. If the configuration isn't associated with any /// repository, this will always be nil. -@property (nonatomic, readonly, copy, nullable) NSArray *remotes; +@property (nonatomic, readonly, copy) NSArray * _Nullable remotes; - (instancetype)init NS_UNAVAILABLE; /// Creates and returns a configuration which includes the global, XDG, and /// system configurations. -+ (nullable instancetype)defaultConfiguration; ++ (instancetype _Nullable)defaultConfiguration; /// The underlying `git_config` object. - (git_config *)git_config __attribute__((objc_returns_inner_pointer)); - (void)setString:(NSString *)s forKey:(NSString *)key; -- (nullable NSString *)stringForKey:(NSString *)key; +- (NSString * _Nullable)stringForKey:(NSString *)key; - (void)setBool:(BOOL)b forKey:(NSString *)key; - (BOOL)boolForKey:(NSString *)key; diff --git a/ObjectiveGit/GTCredential.h b/ObjectiveGit/GTCredential.h index 0bb210ab5..560a8ba18 100644 --- a/ObjectiveGit/GTCredential.h +++ b/ObjectiveGit/GTCredential.h @@ -46,7 +46,7 @@ NS_ASSUME_NONNULL_BEGIN /// type - the credential types allowed by the operation. /// URL - the URL the operation is authenticating against. /// userName - the user name provided by the operation. Can be nil, and might be ignored. -- (GTCredential * _Nullable)credentialForType:(GTCredentialType)type URL:(nullable NSString *)URL userName:(nullable NSString *)userName; +- (GTCredential * _Nullable)credentialForType:(GTCredentialType)type URL:(NSString * _Nullable)URL userName:(NSString * _Nullable)userName; @end /// The GTCredential class is used to provide authentication data. @@ -60,7 +60,7 @@ NS_ASSUME_NONNULL_BEGIN /// error - If not NULL, set to any errors that occur. /// /// Return a new GTCredential instance, or nil if an error occurred -+ (nullable instancetype)credentialWithUserName:(NSString *)userName password:(NSString *)password error:(NSError **)error; ++ (instancetype _Nullable)credentialWithUserName:(NSString *)userName password:(NSString *)password error:(NSError **)error; /// Create a credential object from a SSH keyfile /// @@ -72,7 +72,7 @@ NS_ASSUME_NONNULL_BEGIN /// error - If not NULL, set to any errors that occur. /// /// Return a new GTCredential instance, or nil if an error occurred -+ (nullable instancetype)credentialWithUserName:(NSString *)userName publicKeyURL:(nullable NSURL *)publicKeyURL privateKeyURL:(NSURL *)privateKeyURL passphrase:(nullable NSString *)passphrase error:(NSError **)error; ++ (instancetype _Nullable)credentialWithUserName:(NSString *)userName publicKeyURL:(NSURL * _Nullable)publicKeyURL privateKeyURL:(NSURL *)privateKeyURL passphrase:(NSString * _Nullable)passphrase error:(NSError **)error; /// Create a credential object from a SSH keyfile data string /// @@ -84,7 +84,7 @@ NS_ASSUME_NONNULL_BEGIN /// error - If not NULL, set to any errors that occur. /// /// Return a new GTCredential instance, or nil if an error occurred -+ (nullable instancetype)credentialWithUserName:(NSString *)userName publicKeyString:(nullable NSString *)publicKeyString privateKeyString:(NSString *)privateKeyString passphrase:(nullable NSString *)passphrase error:(NSError **)error; ++ (instancetype _Nullable)credentialWithUserName:(NSString *)userName publicKeyString:(NSString * _Nullable)publicKeyString privateKeyString:(NSString *)privateKeyString passphrase:(NSString * _Nullable)passphrase error:(NSError **)error; /// The underlying `git_cred` object. - (git_cred *)git_cred __attribute__((objc_returns_inner_pointer)); diff --git a/ObjectiveGit/GTDiff+Private.h b/ObjectiveGit/GTDiff+Private.h index 03b7f9146..bcf640921 100644 --- a/ObjectiveGit/GTDiff+Private.h +++ b/ObjectiveGit/GTDiff+Private.h @@ -14,6 +14,6 @@ /// provides a pointer to that structure to the given `block`. /// /// Returns the result of invoking `block`. -+ (int)handleParsedOptionsDictionary:(nullable NSDictionary *)dictionary usingBlock:(nonnull int (^)(git_diff_options * __null_unspecified optionsStruct))block; ++ (int)handleParsedOptionsDictionary:(NSDictionary * _Nullable)dictionary usingBlock:(int (^ _Nonnull)(git_diff_options * _Null_unspecified optionsStruct))block; @end diff --git a/ObjectiveGit/GTDiff.h b/ObjectiveGit/GTDiff.h index f25eee875..991bb5c95 100644 --- a/ObjectiveGit/GTDiff.h +++ b/ObjectiveGit/GTDiff.h @@ -199,7 +199,7 @@ typedef NS_OPTIONS(NSInteger, GTDiffFindOptionsFlags) { /// available. /// /// Returns a newly created `GTDiff` object or nil on error. -+ (nullable instancetype)diffOldTree:(nullable GTTree *)oldTree withNewTree:(nullable GTTree *)newTree inRepository:(GTRepository *)repository options:(nullable NSDictionary *)options error:(NSError **)error; ++ (instancetype _Nullable)diffOldTree:(GTTree * _Nullable)oldTree withNewTree:(GTTree * _Nullable)newTree inRepository:(GTRepository *)repository options:(NSDictionary * _Nullable)options error:(NSError **)error; /// Create a diff between `GTTree` and `GTIndex`. /// @@ -216,7 +216,7 @@ typedef NS_OPTIONS(NSInteger, GTDiffFindOptionsFlags) { /// available. /// /// Returns a newly created `GTDiff` object or nil on error. -+ (nullable instancetype)diffOldTree:(nullable GTTree *)oldTree withNewIndex:(nullable GTIndex *)newIndex inRepository:(GTRepository *)repository options:(nullable NSDictionary *)options error:(NSError **)error; ++ (instancetype _Nullable)diffOldTree:(GTTree * _Nullable)oldTree withNewIndex:(GTIndex * _Nullable)newIndex inRepository:(GTRepository *)repository options:(NSDictionary * _Nullable)options error:(NSError **)error; /// Create a diff between two `GTIndex`es. /// @@ -233,7 +233,7 @@ typedef NS_OPTIONS(NSInteger, GTDiffFindOptionsFlags) { /// available. /// /// Returns a newly created `GTDiff` object or nil on error. -+ (nullable instancetype)diffOldIndex:(nullable GTIndex *)oldIndex withNewIndex:(nullable GTIndex *)newIndex inRepository:(GTRepository *)repository options:(nullable NSDictionary *)options error:(NSError **)error; ++ (instancetype _Nullable)diffOldIndex:(GTIndex * _Nullable)oldIndex withNewIndex:(GTIndex * _Nullable)newIndex inRepository:(GTRepository *)repository options:(NSDictionary * _Nullable)options error:(NSError **)error; /// Create a diff between a repository's current index. /// @@ -253,7 +253,7 @@ typedef NS_OPTIONS(NSInteger, GTDiffFindOptionsFlags) { /// available. /// /// Returns a newly created `GTDiff` object or nil on error. -+ (nullable instancetype)diffIndexFromTree:(nullable GTTree *)tree inRepository:(nullable GTRepository *)repository options:(nullable NSDictionary *)options error:(NSError **)error; ++ (instancetype _Nullable)diffIndexFromTree:(GTTree * _Nullable)tree inRepository:(GTRepository * _Nullable)repository options:(NSDictionary * _Nullable)options error:(NSError **)error; /// Create a diff between the index and working directory in a given repository. /// @@ -266,7 +266,7 @@ typedef NS_OPTIONS(NSInteger, GTDiffFindOptionsFlags) { /// available. /// /// Returns a newly created `GTDiff` object or nil on error. -+ (nullable instancetype)diffIndexToWorkingDirectoryInRepository:(GTRepository *)repository options:(nullable NSDictionary *)options error:(NSError **)error; ++ (instancetype _Nullable)diffIndexToWorkingDirectoryInRepository:(GTRepository *)repository options:(NSDictionary * _Nullable)options error:(NSError **)error; /// Create a diff between a repository's working directory and a tree. /// @@ -279,7 +279,7 @@ typedef NS_OPTIONS(NSInteger, GTDiffFindOptionsFlags) { /// available. /// /// Returns a newly created `GTDiff` object or nil on error. -+ (nullable instancetype)diffWorkingDirectoryFromTree:(nullable GTTree *)tree inRepository:(GTRepository *)repository options:(nullable NSDictionary *)options error:(NSError **)error; ++ (instancetype _Nullable)diffWorkingDirectoryFromTree:(GTTree * _Nullable)tree inRepository:(GTRepository *)repository options:(NSDictionary * _Nullable)options error:(NSError **)error; /// Create a diff between the working directory and HEAD. /// @@ -292,7 +292,7 @@ typedef NS_OPTIONS(NSInteger, GTDiffFindOptionsFlags) { /// error - Populated if an error occurs. /// /// Returns a newly created GTDiff, or nil if an error occurred. -+ (nullable instancetype)diffWorkingDirectoryToHEADInRepository:(GTRepository *)repository options:(nullable NSDictionary *)options error:(NSError **)error; ++ (instancetype _Nullable)diffWorkingDirectoryToHEADInRepository:(GTRepository *)repository options:(NSDictionary * _Nullable)options error:(NSError **)error; - (instancetype)init NS_UNAVAILABLE; @@ -302,7 +302,7 @@ typedef NS_OPTIONS(NSInteger, GTDiffFindOptionsFlags) { /// repository - The repository in which the diff lives. Cannot be nil. /// /// Returns the initialized object. -- (nullable instancetype)initWithGitDiff:(git_diff *)diff repository:(GTRepository *)repository NS_DESIGNATED_INITIALIZER; +- (instancetype _Nullable)initWithGitDiff:(git_diff *)diff repository:(GTRepository *)repository NS_DESIGNATED_INITIALIZER; /// The libgit2 diff object. - (git_diff *)git_diff __attribute__((objc_returns_inner_pointer)); @@ -327,7 +327,7 @@ typedef NS_OPTIONS(NSInteger, GTDiffFindOptionsFlags) { /// /// options - A dictionary containing any of the above find options key constants /// or nil to use the defaults. -- (void)findSimilarWithOptions:(nullable NSDictionary *)options; +- (void)findSimilarWithOptions:(NSDictionary * _Nullable)options; /// Merge a diff with another diff. /// diff --git a/ObjectiveGit/GTDiff.m b/ObjectiveGit/GTDiff.m index c0945d3b4..b3de61898 100644 --- a/ObjectiveGit/GTDiff.m +++ b/ObjectiveGit/GTDiff.m @@ -110,7 +110,7 @@ + (instancetype)diffOldTree:(GTTree *)oldTree withNewIndex:(GTIndex *)newIndex i return [[self alloc] initWithGitDiff:diff repository:repository]; } -+ (nullable instancetype)diffOldIndex:(GTIndex *)oldIndex withNewIndex:(GTIndex *)newIndex inRepository:(GTRepository *)repository options:(NSDictionary *)options error:(NSError **)error ++ (instancetype)diffOldIndex:(GTIndex *)oldIndex withNewIndex:(GTIndex *)newIndex inRepository:(GTRepository *)repository options:(NSDictionary *)options error:(NSError **)error { NSParameterAssert(repository != nil); diff --git a/ObjectiveGit/GTDiffDelta.h b/ObjectiveGit/GTDiffDelta.h index 0c3c83eb4..88bd2bad9 100644 --- a/ObjectiveGit/GTDiffDelta.h +++ b/ObjectiveGit/GTDiffDelta.h @@ -88,7 +88,7 @@ NS_ASSUME_NONNULL_BEGIN /// error - If not NULL, set to any error that occurs. /// /// Returns a diff delta, or nil if an error occurs. -+ (nullable instancetype)diffDeltaFromBlob:(nullable GTBlob *)oldBlob forPath:(nullable NSString *)oldBlobPath toBlob:(nullable GTBlob *)newBlob forPath:(nullable NSString *)newBlobPath options:(nullable NSDictionary *)options error:(NSError **)error; ++ (instancetype _Nullable)diffDeltaFromBlob:(GTBlob * _Nullable)oldBlob forPath:(NSString * _Nullable)oldBlobPath toBlob:(GTBlob * _Nullable)newBlob forPath:(NSString * _Nullable)newBlobPath options:(NSDictionary * _Nullable)options error:(NSError **)error; /// Diffs the given blob and data buffer. /// @@ -103,7 +103,7 @@ NS_ASSUME_NONNULL_BEGIN /// error - If not NULL, set to any error that occurs. /// /// Returns a diff delta, or nil if an error occurs. -+ (nullable instancetype)diffDeltaFromBlob:(nullable GTBlob *)blob forPath:(nullable NSString *)blobPath toData:(nullable NSData *)data forPath:(nullable NSString *)dataPath options:(nullable NSDictionary *)options error:(NSError **)error; ++ (instancetype _Nullable)diffDeltaFromBlob:(GTBlob * _Nullable)blob forPath:(NSString * _Nullable)blobPath toData:(NSData * _Nullable)data forPath:(NSString * _Nullable)dataPath options:(NSDictionary * _Nullable)options error:(NSError **)error; /// Diffs the given data buffers. /// @@ -118,7 +118,7 @@ NS_ASSUME_NONNULL_BEGIN /// error - If not NULL, set to any error that occurs. /// /// Returns a diff delta, or nil if an error occurs. -+ (nullable instancetype)diffDeltaFromData:(nullable NSData *)oldData forPath:(nullable NSString *)oldDataPath toData:(nullable NSData *)newData forPath:(nullable NSString *)newDataPath options:(nullable NSDictionary *)options error:(NSError **)error; ++ (instancetype _Nullable)diffDeltaFromData:(NSData * _Nullable)oldData forPath:(NSString * _Nullable)oldDataPath toData:(NSData * _Nullable)newData forPath:(NSString * _Nullable)newDataPath options:(NSDictionary * _Nullable)options error:(NSError **)error; - (instancetype)init NS_UNAVAILABLE; @@ -128,7 +128,7 @@ NS_ASSUME_NONNULL_BEGIN /// deltaIndex - The index of the delta within the diff. /// /// Returns a diff delta, or nil if an error occurs. -- (nullable instancetype)initWithDiff:(GTDiff *)diff deltaIndex:(NSUInteger)deltaIndex; +- (instancetype _Nullable)initWithDiff:(GTDiff *)diff deltaIndex:(NSUInteger)deltaIndex; /// Creates a patch from a text delta. /// @@ -137,7 +137,7 @@ NS_ASSUME_NONNULL_BEGIN /// error - If not NULL, set to any error that occurs. /// /// Returns a new patch, or nil if an error occurs. -- (nullable GTDiffPatch *)generatePatch:(NSError **)error; +- (GTDiffPatch * _Nullable)generatePatch:(NSError **)error; @end diff --git a/ObjectiveGit/GTDiffFile.h b/ObjectiveGit/GTDiffFile.h index 5f277ff28..e88935ffb 100644 --- a/ObjectiveGit/GTDiffFile.h +++ b/ObjectiveGit/GTDiffFile.h @@ -43,7 +43,7 @@ NS_ASSUME_NONNULL_BEGIN @property (nonatomic, readonly) mode_t mode; /// The OID for the file. -@property (nonatomic, readonly, copy, nullable) GTOID *OID; +@property (nonatomic, readonly, copy) GTOID * _Nullable OID; /// The git_diff_file represented by the receiver. @property (nonatomic, readonly) git_diff_file git_diff_file; @@ -55,7 +55,7 @@ NS_ASSUME_NONNULL_BEGIN /// file - The git_diff_file wrapped by the receiver. /// /// Returns an initialized GTDiffFile. -- (nullable instancetype)initWithGitDiffFile:(git_diff_file)file NS_DESIGNATED_INITIALIZER; +- (instancetype _Nullable)initWithGitDiffFile:(git_diff_file)file NS_DESIGNATED_INITIALIZER; @end diff --git a/ObjectiveGit/GTDiffHunk.h b/ObjectiveGit/GTDiffHunk.h index 8c3653efe..164185e58 100644 --- a/ObjectiveGit/GTDiffHunk.h +++ b/ObjectiveGit/GTDiffHunk.h @@ -45,7 +45,7 @@ NS_ASSUME_NONNULL_BEGIN /// hunkIndex - The hunk's index within the patch. /// /// Returns the initialized instance. -- (nullable instancetype)initWithPatch:(GTDiffPatch *)patch hunkIndex:(NSUInteger)hunkIndex NS_DESIGNATED_INITIALIZER; +- (instancetype _Nullable)initWithPatch:(GTDiffPatch *)patch hunkIndex:(NSUInteger)hunkIndex NS_DESIGNATED_INITIALIZER; /// Perfoms the given block on each line in the hunk. /// diff --git a/ObjectiveGit/GTDiffLine.h b/ObjectiveGit/GTDiffLine.h index bb54d2234..26dc1949f 100644 --- a/ObjectiveGit/GTDiffLine.h +++ b/ObjectiveGit/GTDiffLine.h @@ -52,7 +52,7 @@ NS_ASSUME_NONNULL_BEGIN /// line - The diff line to wrap. May not be NULL. /// /// Returns a diff line, or nil if an error occurs. -- (nullable instancetype)initWithGitLine:(const git_diff_line *)line NS_DESIGNATED_INITIALIZER; +- (instancetype _Nullable)initWithGitLine:(const git_diff_line *)line NS_DESIGNATED_INITIALIZER; @end diff --git a/ObjectiveGit/GTDiffPatch.h b/ObjectiveGit/GTDiffPatch.h index 86971a6f0..a76b6de9e 100644 --- a/ObjectiveGit/GTDiffPatch.h +++ b/ObjectiveGit/GTDiffPatch.h @@ -40,7 +40,7 @@ NS_ASSUME_NONNULL_BEGIN /// automatically be freed when the receiver is deallocated. Must not be /// NULL. /// delta - The diff delta corresponding to this patch. Must not be nil. -- (nullable instancetype)initWithGitPatch:(git_patch *)patch delta:(GTDiffDelta *)delta NS_DESIGNATED_INITIALIZER; +- (instancetype _Nullable)initWithGitPatch:(git_patch *)patch delta:(GTDiffDelta *)delta NS_DESIGNATED_INITIALIZER; /// Returns the underlying patch object. - (git_patch *)git_patch __attribute__((objc_returns_inner_pointer)); diff --git a/ObjectiveGit/GTEnumerator.h b/ObjectiveGit/GTEnumerator.h index 900d3e60a..2ab38b841 100644 --- a/ObjectiveGit/GTEnumerator.h +++ b/ObjectiveGit/GTEnumerator.h @@ -70,7 +70,7 @@ NS_ASSUME_NONNULL_BEGIN /// error - If not NULL, set to any error that occurs. /// /// Returns an initialized enumerator, or nil if an error occurs. -- (nullable id)initWithRepository:(GTRepository *)repo error:(NSError **)error NS_DESIGNATED_INITIALIZER; +- (id _Nullable)initWithRepository:(GTRepository *)repo error:(NSError **)error NS_DESIGNATED_INITIALIZER; /// Marks a commit to start traversal from. /// @@ -115,7 +115,7 @@ NS_ASSUME_NONNULL_BEGIN /// error - If not NULL, set to any error that occurs during traversal. /// /// Returns a (possibly empty) array of GTCommits, or nil if an error occurs. -- (nullable NSArray *)allObjectsWithError:(NSError **)error; +- (NSArray * _Nullable)allObjectsWithError:(NSError **)error; /// Get the next OID. /// @@ -125,7 +125,7 @@ NS_ASSUME_NONNULL_BEGIN /// error - If not NULL, set to any error that occurs during traversal. /// /// Returns nil if an error occurs or the enumeration is done. -- (nullable GTOID *)nextOIDWithSuccess:(nullable BOOL *)success error:(NSError **)error; +- (GTOID * _Nullable)nextOIDWithSuccess:(BOOL * _Nullable)success error:(NSError **)error; /// Gets the next commit. /// @@ -135,7 +135,7 @@ NS_ASSUME_NONNULL_BEGIN /// error - If not NULL, set to any error that occurs during traversal. /// /// Returns nil if an error occurs or the receiver is exhausted. -- (nullable GTCommit *)nextObjectWithSuccess:(nullable BOOL *)success error:(NSError **)error; +- (GTCommit * _Nullable)nextObjectWithSuccess:(BOOL * _Nullable)success error:(NSError **)error; /// Counts the number of commits that were not enumerated, completely exhausting /// the receiver. diff --git a/ObjectiveGit/GTFetchHeadEntry.h b/ObjectiveGit/GTFetchHeadEntry.h index 20b2b9a2f..fd6fa466f 100644 --- a/ObjectiveGit/GTFetchHeadEntry.h +++ b/ObjectiveGit/GTFetchHeadEntry.h @@ -39,7 +39,7 @@ NS_ASSUME_NONNULL_BEGIN /// merge - Indicates if this is pending a merge. /// /// Returns an initialized fetch head entry, or nil if an error occurred. -- (nullable instancetype)initWithReference:(GTReference *)reference remoteURLString:(NSString *)remoteURLString targetOID:(GTOID *)targetOID isMerge:(BOOL)merge NS_DESIGNATED_INITIALIZER; +- (instancetype _Nullable)initWithReference:(GTReference *)reference remoteURLString:(NSString *)remoteURLString targetOID:(GTOID *)targetOID isMerge:(BOOL)merge NS_DESIGNATED_INITIALIZER; @end diff --git a/ObjectiveGit/GTFilter.h b/ObjectiveGit/GTFilter.h index 8f70cc5e3..51b2e7196 100644 --- a/ObjectiveGit/GTFilter.h +++ b/ObjectiveGit/GTFilter.h @@ -34,7 +34,7 @@ extern const NSInteger GTFilterErrorNameAlreadyRegistered; /// The check block. Determines whether the `applyBlock` should be run for given /// source. -@property (nonatomic, copy) BOOL (^checkBlock)(void * __null_unspecified * __null_unspecified payload, GTFilterSource *source, const char * __null_unspecified * __null_unspecified attr_values); +@property (nonatomic, copy) BOOL (^checkBlock)(void * _Null_unspecified * _Null_unspecified payload, GTFilterSource *source, const char * _Null_unspecified * _Null_unspecified attr_values); /// The cleanup block. Called after the `applyBlock` to given the filter a /// chance to clean up the `payload`. @@ -49,7 +49,7 @@ extern const NSInteger GTFilterErrorNameAlreadyRegistered; /// applyBlock - The block to use to apply the filter. Cannot be nil. /// /// Returns the initialized object. -- (nullable instancetype)initWithName:(NSString *)name attributes:(nullable NSString *)attributes applyBlock:(NSData * (^)(void *__null_unspecified * __null_unspecified payload, NSData *from, GTFilterSource *source, BOOL *applied))applyBlock NS_DESIGNATED_INITIALIZER; +- (instancetype _Nullable)initWithName:(NSString *)name attributes:(NSString * _Nullable)attributes applyBlock:(NSData * (^)(void * _Null_unspecified * _Null_unspecified payload, NSData *from, GTFilterSource *source, BOOL *applied))applyBlock NS_DESIGNATED_INITIALIZER; /// Look up a filter based on its name. /// @@ -59,7 +59,7 @@ extern const NSInteger GTFilterErrorNameAlreadyRegistered; /// name - The name of the filter to retrieve. Must not be nil. /// /// Returns the filter, or nil if none was found. -+ (nullable GTFilter *)filterForName:(NSString *)name; ++ (GTFilter * _Nullable)filterForName:(NSString *)name; /// Registers the filter with the given priority. /// diff --git a/ObjectiveGit/GTFilterList.h b/ObjectiveGit/GTFilterList.h index 7b45f4b70..6ddf3ca98 100644 --- a/ObjectiveGit/GTFilterList.h +++ b/ObjectiveGit/GTFilterList.h @@ -32,7 +32,7 @@ NS_ASSUME_NONNULL_BEGIN /// Must not be NULL. /// /// Returns an initialized filter list, or nil if an error occurred. -- (nullable instancetype)initWithGitFilterList:(git_filter_list *)filterList NS_DESIGNATED_INITIALIZER; +- (instancetype _Nullable)initWithGitFilterList:(git_filter_list *)filterList NS_DESIGNATED_INITIALIZER; /// Returns the underlying `git_filter_list`. - (git_filter_list *)git_filter_list __attribute__((objc_returns_inner_pointer)); @@ -43,7 +43,7 @@ NS_ASSUME_NONNULL_BEGIN /// error - If not NULL, set to any error that occurs. /// /// Returns the filtered data, or nil if an error occurs. -- (nullable NSData *)applyToData:(NSData *)inputData error:(NSError **)error; +- (NSData * _Nullable)applyToData:(NSData *)inputData error:(NSError **)error; /// Attempts to apply the filter list to a file in the given repository. /// @@ -53,7 +53,7 @@ NS_ASSUME_NONNULL_BEGIN /// error - If not NULL, set to any error that occurs. /// /// Returns the filtered data, or nil if an error occurs. -- (nullable NSData *)applyToPath:(NSString *)relativePath inRepository:(GTRepository *)repository error:(NSError **)error; +- (NSData * _Nullable)applyToPath:(NSString *)relativePath inRepository:(GTRepository *)repository error:(NSError **)error; /// Attempts to apply the filter list to a blob. /// @@ -61,7 +61,7 @@ NS_ASSUME_NONNULL_BEGIN /// error - If not NULL, set to any error that occurs. /// /// Returns the filtered data, or nil if an error occurs. -- (nullable NSData *)applyToBlob:(GTBlob *)blob error:(NSError **)error; +- (NSData * _Nullable)applyToBlob:(GTBlob *)blob error:(NSError **)error; @end diff --git a/ObjectiveGit/GTFilterSource.h b/ObjectiveGit/GTFilterSource.h index e7d60c2cc..e168846d0 100644 --- a/ObjectiveGit/GTFilterSource.h +++ b/ObjectiveGit/GTFilterSource.h @@ -35,7 +35,7 @@ NS_ASSUME_NONNULL_BEGIN /// The OID of the source. Will be nil if the source doesn't exist in the object /// database. -@property (nonatomic, readonly, strong, nullable) GTOID *OID; +@property (nonatomic, readonly, strong) GTOID * _Nullable OID; /// The filter mode. @property (nonatomic, readonly, assign) GTFilterSourceMode mode; @@ -47,7 +47,7 @@ NS_ASSUME_NONNULL_BEGIN /// source - The filter source. Cannot be NULL. /// /// Returns the initialized object. -- (nullable instancetype)initWithGitFilterSource:(const git_filter_source *)source NS_DESIGNATED_INITIALIZER; +- (instancetype _Nullable)initWithGitFilterSource:(const git_filter_source *)source NS_DESIGNATED_INITIALIZER; @end diff --git a/ObjectiveGit/GTIndex.h b/ObjectiveGit/GTIndex.h index 8d4c7919b..ba57ac2f3 100644 --- a/ObjectiveGit/GTIndex.h +++ b/ObjectiveGit/GTIndex.h @@ -40,10 +40,10 @@ NS_ASSUME_NONNULL_BEGIN /// The repository in which the index resides. This may be nil if the index was /// created with -initWithFileURL:error:. -@property (nonatomic, readonly, strong, nullable) GTRepository *repository; +@property (nonatomic, readonly, strong) GTRepository * _Nullable repository; /// The file URL for the index if it exists on disk; nil otherwise. -@property (nonatomic, readonly, copy, nullable) NSURL *fileURL; +@property (nonatomic, readonly, copy) NSURL * _Nullable fileURL; /// The number of entries in the index. @property (nonatomic, readonly) NSUInteger entryCount; @@ -60,7 +60,7 @@ NS_ASSUME_NONNULL_BEGIN /// error - If not NULL, set to any error that occurs. /// /// Returns the newly created index, or nil if an error occurred. -+ (nullable instancetype)inMemoryIndexWithRepository:(GTRepository *)repository error:(NSError **)error; ++ (instancetype _Nullable)inMemoryIndexWithRepository:(GTRepository *)repository error:(NSError **)error; /// Loads the index at the given file URL. /// @@ -69,7 +69,7 @@ NS_ASSUME_NONNULL_BEGIN /// error - If not NULL, set to any error that occurs. /// /// Returns the loaded index, or nil if an error occurred. -+ (nullable instancetype)indexWithFileURL:(NSURL *)fileURL repository:(GTRepository *)repository error:(NSError **)error; ++ (instancetype _Nullable)indexWithFileURL:(NSURL *)fileURL repository:(GTRepository *)repository error:(NSError **)error; - (instancetype)init NS_UNAVAILABLE; @@ -105,10 +105,10 @@ NS_ASSUME_NONNULL_BEGIN /// index - The index of the entry to get. Must be within 0 and self.entryCount. /// /// Returns a new GTIndexEntry, or nil if an error occurred. -- (nullable GTIndexEntry *)entryAtIndex:(NSUInteger)index; +- (GTIndexEntry * _Nullable)entryAtIndex:(NSUInteger)index; /// Get the entry with the given path, or nil if an error occurred. -- (nullable GTIndexEntry *)entryWithPath:(NSString *)path; +- (GTIndexEntry * _Nullable)entryWithPath:(NSString *)path; /// Get the entry with the given name. /// @@ -116,7 +116,7 @@ NS_ASSUME_NONNULL_BEGIN /// error - The error if one occurred. /// /// Returns a new GTIndexEntry, or nil if an error occurred. -- (nullable GTIndexEntry *)entryWithPath:(NSString *)path error:(NSError **)error; +- (GTIndexEntry * _Nullable)entryWithPath:(NSString *)path error:(NSError **)error; /// Add an entry to the index. /// @@ -179,7 +179,7 @@ NS_ASSUME_NONNULL_BEGIN /// error - The error if one occurred. /// /// Returns a new GTTree, or nil if an error occurred. -- (nullable GTTree *)writeTree:(NSError **)error; +- (GTTree * _Nullable)writeTree:(NSError **)error; /// Write the index to the given repository as a tree. /// Will fail if the receiver's index has conflicts. @@ -188,7 +188,7 @@ NS_ASSUME_NONNULL_BEGIN /// error - The error if one occurred. /// /// Returns a new GTTree or nil if an error occurred. -- (nullable GTTree *)writeTreeToRepository:(GTRepository *)repository error:(NSError **)error; +- (GTTree * _Nullable)writeTreeToRepository:(GTRepository *)repository error:(NSError **)error; /// Enumerate through any conflicts in the index, running the provided block each /// time. @@ -220,11 +220,11 @@ NS_ASSUME_NONNULL_BEGIN /// error - When something goes wrong, this parameter is set. Optional. /// /// Returns `YES` in the event that everything has gone smoothly. Otherwise, `NO`. -- (BOOL)updatePathspecs:(nullable NSArray *)pathspecs error:(NSError **)error passingTest:(nullable BOOL (^)(NSString *matchedPathspec, NSString *path, BOOL *stop))block; +- (BOOL)updatePathspecs:(NSArray * _Nullable)pathspecs error:(NSError **)error passingTest:(BOOL (^ _Nullable)(NSString *matchedPathspec, NSString *path, BOOL *stop))block; #pragma mark Deprecations -- (nullable GTIndexEntry *)entryWithName:(NSString *)name __deprecated_msg("use entryWithPath: instead."); -- (nullable GTIndexEntry *)entryWithName:(NSString *)name error:(NSError **)error __deprecated_msg("use entryWithPath:error: instead."); +- (GTIndexEntry * _Nullable)entryWithName:(NSString *)name __deprecated_msg("use entryWithPath: instead."); +- (GTIndexEntry * _Nullable)entryWithName:(NSString *)name error:(NSError **)error __deprecated_msg("use entryWithPath:error: instead."); @end diff --git a/ObjectiveGit/GTIndexEntry.h b/ObjectiveGit/GTIndexEntry.h index 8b5ff9f23..1e2f26d33 100644 --- a/ObjectiveGit/GTIndexEntry.h +++ b/ObjectiveGit/GTIndexEntry.h @@ -54,14 +54,14 @@ NS_ASSUME_NONNULL_BEGIN /// error - will be filled if an error occurs /// /// Returns the initialized object. -- (instancetype)initWithGitIndexEntry:(const git_index_entry *)entry index:(nullable GTIndex *)index error:(NSError **)error NS_DESIGNATED_INITIALIZER; +- (instancetype)initWithGitIndexEntry:(const git_index_entry *)entry index:(GTIndex * _Nullable)index error:(NSError **)error NS_DESIGNATED_INITIALIZER; - (instancetype)initWithGitIndexEntry:(const git_index_entry *)entry; /// The underlying `git_index_entry` object. - (const git_index_entry *)git_index_entry __attribute__((objc_returns_inner_pointer)); /// The entry's index. This may be nil if nil is passed in to -initWithGitIndexEntry: -@property (nonatomic, strong, readonly, nullable) GTIndex *index; +@property (nonatomic, strong, readonly) GTIndex * _Nullable index; /// The repository-relative path for the entry. @property (nonatomic, readonly, copy) NSString *path; @@ -86,8 +86,8 @@ NS_ASSUME_NONNULL_BEGIN @interface GTObject (GTIndexEntry) -+ (nullable instancetype)objectWithIndexEntry:(GTIndexEntry *)indexEntry error:(NSError **)error; -- (nullable instancetype)initWithIndexEntry:(GTIndexEntry *)indexEntry error:(NSError **)error; ++ (instancetype _Nullable)objectWithIndexEntry:(GTIndexEntry *)indexEntry error:(NSError **)error; +- (instancetype _Nullable)initWithIndexEntry:(GTIndexEntry *)indexEntry error:(NSError **)error; @end diff --git a/ObjectiveGit/GTNote.h b/ObjectiveGit/GTNote.h index 509a2bbd1..01955057f 100644 --- a/ObjectiveGit/GTNote.h +++ b/ObjectiveGit/GTNote.h @@ -40,10 +40,10 @@ NS_ASSUME_NONNULL_BEGIN @interface GTNote : NSObject {} /// The author of the note. -@property (nonatomic, readonly, strong, nullable) GTSignature *author; +@property (nonatomic, readonly, strong) GTSignature * _Nullable author; /// The committer of the note. -@property (nonatomic, readonly, strong, nullable) GTSignature *committer; +@property (nonatomic, readonly, strong) GTSignature * _Nullable committer; /// Content of the note. @property (nonatomic, readonly, strong) NSString *note; @@ -62,7 +62,7 @@ NS_ASSUME_NONNULL_BEGIN /// May be NULL. /// /// Returns initialized GTNote instance or nil on failure (error will be populated, if passed). -- (nullable instancetype)initWithTargetOID:(GTOID *)oid repository:(GTRepository *)repository referenceName:(nullable NSString *)referenceName error:(NSError **)error; +- (instancetype _Nullable)initWithTargetOID:(GTOID *)oid repository:(GTRepository *)repository referenceName:(NSString * _Nullable)referenceName error:(NSError **)error; /// Create a note with target libgit2 oid in the given repository. /// @@ -71,7 +71,7 @@ NS_ASSUME_NONNULL_BEGIN /// referenceName - Name for the notes reference in the repo, or NULL for default ("refs/notes/commits") /// /// Returns initialized GTNote instance or nil on failure. -- (nullable instancetype)initWithTargetGitOID:(git_oid *)oid repository:(git_repository *)repository referenceName:(const char * _Nullable)referenceName error:(NSError **)error NS_DESIGNATED_INITIALIZER; +- (instancetype _Nullable)initWithTargetGitOID:(git_oid *)oid repository:(git_repository *)repository referenceName:(const char * _Nullable)referenceName error:(NSError **)error NS_DESIGNATED_INITIALIZER; - (instancetype)init NS_UNAVAILABLE; @@ -83,7 +83,7 @@ NS_ASSUME_NONNULL_BEGIN /// May be NULL. /// /// Returns default reference name (usually "refs/notes/commits"). -+ (nullable NSString *)defaultReferenceNameForRepository:(GTRepository *)repository error:(NSError **)error; ++ (NSString * _Nullable)defaultReferenceNameForRepository:(GTRepository *)repository error:(NSError **)error; @end diff --git a/ObjectiveGit/GTOID.h b/ObjectiveGit/GTOID.h index 95bda1475..3291d920b 100644 --- a/ObjectiveGit/GTOID.h +++ b/ObjectiveGit/GTOID.h @@ -16,7 +16,7 @@ NS_ASSUME_NONNULL_BEGIN @interface GTOID : NSObject /// The SHA pointed to by the OID. -@property (nonatomic, readonly, copy, nullable) NSString *SHA; +@property (nonatomic, readonly, copy) NSString * _Nullable SHA; /// Is the OID all zero? This usually indicates that the object has not been /// inserted into the ODB yet. @@ -36,7 +36,7 @@ NS_ASSUME_NONNULL_BEGIN /// SHA - The to convert to an OID. Cannot be nil. /// /// Returns the initialized receiver. -- (nullable instancetype)initWithSHA:(NSString *)SHA; +- (instancetype _Nullable)initWithSHA:(NSString *)SHA; /// Initializes the receiver by converting the given SHA to an OID /// optionally returning a NSError instance on failure. @@ -45,14 +45,14 @@ NS_ASSUME_NONNULL_BEGIN /// error - Will be filled with an error object in if the SHA cannot be parsed /// /// Returns the initialized receiver or nil if an error occured. -- (nullable instancetype)initWithSHA:(NSString *)SHA error:(NSError **)error; +- (instancetype _Nullable)initWithSHA:(NSString *)SHA error:(NSError **)error; /// Initializes the receiver by converting the given SHA C string to an OID. /// /// string - The C string to convert. Cannot be NULL. /// /// Returns the initialized receiver. -- (nullable instancetype)initWithSHACString:(const char *)string; +- (instancetype _Nullable)initWithSHACString:(const char *)string; /// Initializes the receiver by converting the given SHA C string to an OID /// optionally returning a NSError instance on failure. @@ -61,16 +61,16 @@ NS_ASSUME_NONNULL_BEGIN /// error - Will be filled with an error object in if the SHA cannot be parsed /// /// Returns the initialized receiver. -- (nullable instancetype)initWithSHACString:(const char *)string error:(NSError **)error NS_DESIGNATED_INITIALIZER; +- (instancetype _Nullable)initWithSHACString:(const char *)string error:(NSError **)error NS_DESIGNATED_INITIALIZER; /// Creates a new instance with the given git_oid using initWithGitOid: + (instancetype)oidWithGitOid:(const git_oid *)git_oid; /// Creates a new instance from the given SHA string using initWithSHAString: -+ (nullable instancetype)oidWithSHA:(NSString *)SHA; ++ (instancetype _Nullable)oidWithSHA:(NSString *)SHA; /// Creates a new instance from the given SHA C string using initWithSHACString: -+ (nullable instancetype)oidWithSHACString:(const char *)SHA; ++ (instancetype _Nullable)oidWithSHACString:(const char *)SHA; /// Returns the underlying git_oid struct. - (const git_oid *)git_oid __attribute__((objc_returns_inner_pointer)); @@ -85,7 +85,7 @@ NS_ASSUME_NONNULL_BEGIN /// type - The type of the git object. /// /// Returns a new OID, or nil if an error occurred. -+ (nullable instancetype)OIDByHashingData:(NSData *)data type:(GTObjectType)type error:(NSError **)error; ++ (instancetype _Nullable)OIDByHashingData:(NSData *)data type:(GTObjectType)type error:(NSError **)error; @end diff --git a/ObjectiveGit/GTObject.h b/ObjectiveGit/GTObject.h index c39abd37b..a66e02b99 100644 --- a/ObjectiveGit/GTObject.h +++ b/ObjectiveGit/GTObject.h @@ -52,18 +52,18 @@ NS_ASSUME_NONNULL_BEGIN @interface GTObject : NSObject @property (nonatomic, readonly) NSString *type; -@property (nonatomic, readonly, nullable) NSString *SHA; -@property (nonatomic, readonly, nullable) NSString *shortSHA; +@property (nonatomic, readonly) NSString * _Nullable SHA; +@property (nonatomic, readonly) NSString * _Nullable shortSHA; @property (nonatomic, readonly, strong) GTRepository *repository; -@property (nonatomic, readonly, nullable) GTOID *OID; +@property (nonatomic, readonly) GTOID * _Nullable OID; - (instancetype)init NS_UNAVAILABLE; /// Designated initializer. -- (nullable id)initWithObj:(git_object *)theObject inRepository:(GTRepository *)theRepo NS_DESIGNATED_INITIALIZER; +- (id _Nullable)initWithObj:(git_object *)theObject inRepository:(GTRepository *)theRepo NS_DESIGNATED_INITIALIZER; /// Class convenience initializer -+ (nullable id)objectWithObj:(git_object *)theObject inRepository:(GTRepository *)theRepo; ++ (id _Nullable)objectWithObj:(git_object *)theObject inRepository:(GTRepository *)theRepo; /// The underlying `git_object`. - (git_object *)git_object __attribute__((objc_returns_inner_pointer)); @@ -73,7 +73,7 @@ NS_ASSUME_NONNULL_BEGIN /// error(out) - will be filled if an error occurs /// /// returns a GTOdbObject or nil if an error occurred. -- (nullable GTOdbObject *)odbObjectWithError:(NSError **)error; +- (GTOdbObject * _Nullable)odbObjectWithError:(NSError **)error; /// Recursively peel an object until an object of the specified type is met. /// @@ -84,7 +84,7 @@ NS_ASSUME_NONNULL_BEGIN /// May be NULL. /// /// Returns the found object or nil on error. -- (nullable id)objectByPeelingToType:(GTObjectType)type error:(NSError **)error; +- (id _Nullable)objectByPeelingToType:(GTObjectType)type error:(NSError **)error; @end diff --git a/ObjectiveGit/GTObjectDatabase.h b/ObjectiveGit/GTObjectDatabase.h index 14cad11d5..c111d8b6a 100644 --- a/ObjectiveGit/GTObjectDatabase.h +++ b/ObjectiveGit/GTObjectDatabase.h @@ -42,13 +42,13 @@ NS_ASSUME_NONNULL_BEGIN /// error - The error if one occurred. /// /// Returns the initialized object. -- (nullable instancetype)initWithRepository:(GTRepository *)repo error:(NSError **)error NS_DESIGNATED_INITIALIZER; +- (instancetype _Nullable)initWithRepository:(GTRepository *)repo error:(NSError **)error NS_DESIGNATED_INITIALIZER; /// The underlying `git_odb` object. - (git_odb *)git_odb __attribute__((objc_returns_inner_pointer)); -- (nullable GTOdbObject *)objectWithOID:(GTOID *)OID error:(NSError **)error; -- (nullable GTOdbObject *)objectWithSHA:(NSString *)SHA error:(NSError **)error; +- (GTOdbObject * _Nullable)objectWithOID:(GTOID *)OID error:(NSError **)error; +- (GTOdbObject * _Nullable)objectWithSHA:(NSString *)SHA error:(NSError **)error; /// Writes the data into the object database. /// @@ -58,7 +58,7 @@ NS_ASSUME_NONNULL_BEGIN /// /// Returns the OID for the object which was written, or nil if an error /// occurred. -- (nullable GTOID *)writeData:(NSData *)data type:(GTObjectType)type error:(NSError **)error; +- (GTOID * _Nullable)writeData:(NSData *)data type:(GTObjectType)type error:(NSError **)error; - (BOOL)containsObjectWithSHA:(NSString *)SHA error:(NSError **)error; diff --git a/ObjectiveGit/GTOdbObject.h b/ObjectiveGit/GTOdbObject.h index 8add7d39f..389bce721 100644 --- a/ObjectiveGit/GTOdbObject.h +++ b/ObjectiveGit/GTOdbObject.h @@ -23,18 +23,18 @@ NS_ASSUME_NONNULL_BEGIN /// repository - The repository in which the object resides. Cannot be nil. /// /// Returns the initialized object. -- (nullable instancetype)initWithOdbObj:(git_odb_object *)object repository:(GTRepository *)repository NS_DESIGNATED_INITIALIZER; +- (instancetype _Nullable)initWithOdbObj:(git_odb_object *)object repository:(GTRepository *)repository NS_DESIGNATED_INITIALIZER; /// The underlying `git_odb_object`. - (git_odb_object *)git_odb_object __attribute__((objc_returns_inner_pointer)); -- (nullable NSString *)shaHash; +- (NSString * _Nullable)shaHash; - (GTObjectType)type; - (size_t)length; -- (nullable NSData *)data; +- (NSData * _Nullable)data; /// The object ID of this object. -@property (nonatomic, readonly, nullable) GTOID *OID; +@property (nonatomic, readonly) GTOID * _Nullable OID; @end diff --git a/ObjectiveGit/GTReference.h b/ObjectiveGit/GTReference.h index e9e0db1d4..cc36b8d70 100644 --- a/ObjectiveGit/GTReference.h +++ b/ObjectiveGit/GTReference.h @@ -52,7 +52,7 @@ NS_ASSUME_NONNULL_BEGIN @property (nonatomic, readonly, strong) GTRepository *repository; @property (nonatomic, readonly) GTReferenceType referenceType; @property (nonatomic, readonly) const git_oid *git_oid; -@property (nonatomic, strong, readonly, nullable) GTOID *OID; +@property (nonatomic, strong, readonly) GTOID * _Nullable OID; /// Whether this is a remote-tracking branch. @property (nonatomic, readonly, getter = isRemote) BOOL remote; @@ -61,8 +61,8 @@ NS_ASSUME_NONNULL_BEGIN @property (nonatomic, readonly, strong) GTReflog *reflog; /// Convenience initializers -+ (nullable instancetype)referenceByResolvingSymbolicReference:(GTReference *)symbolicRef error:(NSError **)error; -- (nullable instancetype)initByResolvingSymbolicReference:(GTReference *)symbolicRef error:(NSError **)error; ++ (instancetype _Nullable)referenceByResolvingSymbolicReference:(GTReference *)symbolicRef error:(NSError **)error; +- (instancetype _Nullable)initByResolvingSymbolicReference:(GTReference *)symbolicRef error:(NSError **)error; - (instancetype)init NS_UNAVAILABLE; @@ -72,16 +72,16 @@ NS_ASSUME_NONNULL_BEGIN /// repository - The repository containing the reference. Must not be nil. /// /// Returns the initialized receiver. -- (nullable instancetype)initWithGitReference:(git_reference *)ref repository:(GTRepository *)repository NS_DESIGNATED_INITIALIZER; +- (instancetype _Nullable)initWithGitReference:(git_reference *)ref repository:(GTRepository *)repository NS_DESIGNATED_INITIALIZER; /// The underlying `git_reference` object. - (git_reference *)git_reference __attribute__((objc_returns_inner_pointer)); /// The target (either GTObject or GTReference) to which the reference points. -@property (nonatomic, readonly, copy, nullable) id unresolvedTarget; +@property (nonatomic, readonly, copy) id _Nullable unresolvedTarget; /// The resolved object to which the reference points. -@property (nonatomic, readonly, copy, nullable) id resolvedTarget; +@property (nonatomic, readonly, copy) id _Nullable resolvedTarget; /// The last direct reference in a chain @property (nonatomic, readonly, copy) GTReference *resolvedReference; @@ -100,10 +100,10 @@ NS_ASSUME_NONNULL_BEGIN /// error - The error if one occurred. /// /// Returns the updated reference, or nil if an error occurred. -- (nullable GTReference *)referenceByUpdatingTarget:(NSString *)newTarget message:(nullable NSString *)message error:(NSError **)error; +- (GTReference * _Nullable)referenceByUpdatingTarget:(NSString *)newTarget message:(NSString * _Nullable)message error:(NSError **)error; /// The name of the reference. -@property (nonatomic, readonly, copy, nullable) NSString *name; +@property (nonatomic, readonly, copy) NSString * _Nullable name; /// Updates the on-disk reference to the name and returns the renamed reference. /// @@ -113,7 +113,7 @@ NS_ASSUME_NONNULL_BEGIN /// error - The error if one occurred. /// /// Returns the renamed reference, or nil if an error occurred. -- (nullable GTReference *)referenceByRenaming:(NSString *)newName error:(NSError **)error; +- (GTReference * _Nullable)referenceByRenaming:(NSString *)newName error:(NSError **)error; /// Delete this reference. /// @@ -127,14 +127,14 @@ NS_ASSUME_NONNULL_BEGIN /// error(out) - will be filled if an error occurs /// /// returns the peeled GTReference or nil if an error occurred. -- (nullable GTReference *)resolvedReferenceWithError:(NSError **)error; +- (GTReference * _Nullable)resolvedReferenceWithError:(NSError **)error; /// Reload the reference from disk. /// /// error - The error if one occurred. /// /// Returns the reloaded reference, or nil if an error occurred. -- (nullable GTReference *)reloadedReferenceWithError:(NSError **)error; +- (GTReference * _Nullable)reloadedReferenceWithError:(NSError **)error; /// An error indicating that the git_reference is no longer valid. + (NSError *)invalidReferenceError; diff --git a/ObjectiveGit/GTReflog+Private.h b/ObjectiveGit/GTReflog+Private.h index cf21c00fe..812cad515 100644 --- a/ObjectiveGit/GTReflog+Private.h +++ b/ObjectiveGit/GTReflog+Private.h @@ -10,6 +10,6 @@ @interface GTReflog () -- (nullable instancetype)init NS_UNAVAILABLE; +- (instancetype _Nullable)init NS_UNAVAILABLE; @end diff --git a/ObjectiveGit/GTReflog.h b/ObjectiveGit/GTReflog.h index 581300f53..feeafea51 100644 --- a/ObjectiveGit/GTReflog.h +++ b/ObjectiveGit/GTReflog.h @@ -26,7 +26,7 @@ NS_ASSUME_NONNULL_BEGIN /// reference - The reference whose reflog is being represented. Cannot be nil. /// /// Returns the initialized object. -- (nullable instancetype)initWithReference:(nonnull GTReference *)reference NS_DESIGNATED_INITIALIZER; +- (instancetype _Nullable)initWithReference:(GTReference * _Nonnull)reference NS_DESIGNATED_INITIALIZER; /// Writes a new entry to the reflog. /// @@ -43,7 +43,7 @@ NS_ASSUME_NONNULL_BEGIN /// than `entryCount`, it will assert. /// /// Returns the entry at that index or nil if not found. -- (nullable GTReflogEntry *)entryAtIndex:(NSUInteger)index; +- (GTReflogEntry * _Nullable)entryAtIndex:(NSUInteger)index; @end diff --git a/ObjectiveGit/GTReflogEntry+Private.h b/ObjectiveGit/GTReflogEntry+Private.h index 8105bab5a..b30415160 100644 --- a/ObjectiveGit/GTReflogEntry+Private.h +++ b/ObjectiveGit/GTReflogEntry+Private.h @@ -19,7 +19,7 @@ NS_ASSUME_NONNULL_BEGIN /// reflog - The reflog in which the entry resides. Cannot be nil. /// /// Returns the initialized object. -- (nullable instancetype)initWithGitReflogEntry:(const git_reflog_entry *)entry reflog:(GTReflog *)reflog NS_DESIGNATED_INITIALIZER; +- (instancetype _Nullable)initWithGitReflogEntry:(const git_reflog_entry *)entry reflog:(GTReflog *)reflog NS_DESIGNATED_INITIALIZER; @end diff --git a/ObjectiveGit/GTReflogEntry.h b/ObjectiveGit/GTReflogEntry.h index c3e08468c..99fcc503f 100644 --- a/ObjectiveGit/GTReflogEntry.h +++ b/ObjectiveGit/GTReflogEntry.h @@ -15,15 +15,15 @@ @interface GTReflogEntry : NSObject /// The OID of the ref before the entry. -@property (nonatomic, readonly, strong, nullable) GTOID *previousOID; +@property (nonatomic, readonly, strong) GTOID * _Nullable previousOID; /// The OID of the ref when the entry was made. -@property (nonatomic, readonly, strong, nullable) GTOID *updatedOID; +@property (nonatomic, readonly, strong) GTOID * _Nullable updatedOID; /// The person who committed the entry. -@property (nonatomic, readonly, strong, nullable) GTSignature *committer; +@property (nonatomic, readonly, strong) GTSignature * _Nullable committer; /// The message associated with the entry. -@property (nonatomic, readonly, copy, nullable) NSString *message; +@property (nonatomic, readonly, copy) NSString * _Nullable message; @end diff --git a/ObjectiveGit/GTRemote.h b/ObjectiveGit/GTRemote.h index 78cbfc386..bde9a37f1 100644 --- a/ObjectiveGit/GTRemote.h +++ b/ObjectiveGit/GTRemote.h @@ -34,13 +34,13 @@ typedef enum { @property (nonatomic, readonly, strong) GTRepository *repository; /// The name of the remote. -@property (nonatomic, readonly, copy, nullable) NSString *name; +@property (nonatomic, readonly, copy) NSString * _Nullable name; /// The URL string for the remote. -@property (nonatomic, readonly, copy, nullable) NSString *URLString; +@property (nonatomic, readonly, copy) NSString * _Nullable URLString; /// The push URL for the remote, if provided. -@property (nonatomic, copy, nullable) NSString *pushURLString; +@property (nonatomic, copy) NSString * _Nullable pushURLString; /// Whether the remote is connected or not. @property (nonatomic, readonly, getter=isConnected) BOOL connected; @@ -56,13 +56,13 @@ typedef enum { /// /// This array will contain NSStrings of the form /// `+refs/heads/*:refs/remotes/REMOTE/*`. -@property (nonatomic, readonly, copy, nullable) NSArray *fetchRefspecs; +@property (nonatomic, readonly, copy) NSArray * _Nullable fetchRefspecs; /// The push refspecs for this remote. /// /// This array will contain NSStrings of the form /// `+refs/heads/*:refs/remotes/REMOTE/*`. -@property (nonatomic, readonly, copy, nullable) NSArray *pushRefspecs; +@property (nonatomic, readonly, copy) NSArray * _Nullable pushRefspecs; /// Tests if a name is valid + (BOOL)isValidRemoteName:(NSString *)name; @@ -75,7 +75,7 @@ typedef enum { /// error - Will be set if an error occurs. /// /// Returns a new remote, or nil if an error occurred -+ (nullable instancetype)createRemoteWithName:(NSString *)name URLString:(NSString *)URLString inRepository:(GTRepository *)repo error:(NSError **)error; ++ (instancetype _Nullable)createRemoteWithName:(NSString *)name URLString:(NSString *)URLString inRepository:(GTRepository *)repo error:(NSError **)error; /// Load a remote from a repository. /// @@ -84,7 +84,7 @@ typedef enum { /// error - Will be set if an error occurs. /// /// Returns the loaded remote, or nil if an error occurred. -+ (nullable instancetype)remoteWithName:(NSString *)name inRepository:(GTRepository *)repo error:(NSError **)error; ++ (instancetype _Nullable)remoteWithName:(NSString *)name inRepository:(GTRepository *)repo error:(NSError **)error; - (instancetype)init NS_UNAVAILABLE; @@ -94,7 +94,7 @@ typedef enum { /// repo - The repository the remote belongs to. Cannot be nil. /// /// Returns the initialized receiver, or nil if an error occurred. -- (nullable instancetype)initWithGitRemote:(git_remote *)remote inRepository:(GTRepository *)repo NS_DESIGNATED_INITIALIZER; +- (instancetype _Nullable)initWithGitRemote:(git_remote *)remote inRepository:(GTRepository *)repo NS_DESIGNATED_INITIALIZER; /// The underlying `git_remote` object. - (git_remote *)git_remote __attribute__((objc_returns_inner_pointer)); diff --git a/ObjectiveGit/GTRepository+Attributes.h b/ObjectiveGit/GTRepository+Attributes.h index 75cdaed30..a86ab6e28 100644 --- a/ObjectiveGit/GTRepository+Attributes.h +++ b/ObjectiveGit/GTRepository+Attributes.h @@ -18,7 +18,7 @@ NS_ASSUME_NONNULL_BEGIN /// path - The path to use for the lookup. Cannot be nil. /// /// Returns the value of the attribute or nil. -- (nullable NSString *)attributeWithName:(NSString *)name path:(NSString *)path; +- (NSString * _Nullable)attributeWithName:(NSString *)name path:(NSString *)path; @end diff --git a/ObjectiveGit/GTRepository+Committing.h b/ObjectiveGit/GTRepository+Committing.h index e77ee2115..4e5518664 100644 --- a/ObjectiveGit/GTRepository+Committing.h +++ b/ObjectiveGit/GTRepository+Committing.h @@ -25,11 +25,11 @@ NS_ASSUME_NONNULL_BEGIN /// error - The error if one occurred. /// /// Returns the newly created commit, or nil if an error occurred. -- (nullable GTCommit *)createCommitWithTree:(GTTree *)tree message:(NSString *)message author:(GTSignature *)author committer:(GTSignature *)committer parents:(nullable NSArray *)parents updatingReferenceNamed:(nullable NSString *)refName error:(NSError **)error; +- (GTCommit * _Nullable)createCommitWithTree:(GTTree *)tree message:(NSString *)message author:(GTSignature *)author committer:(GTSignature *)committer parents:(NSArray * _Nullable)parents updatingReferenceNamed:(NSString * _Nullable)refName error:(NSError **)error; /// Creates a new commit using +createCommitWithTree:message:author:committer:parents:updatingReferenceNamed:error: /// with -userSignatureForNow as both the author and committer. -- (nullable GTCommit *)createCommitWithTree:(GTTree *)tree message:(NSString *)message parents:(nullable NSArray *)parents updatingReferenceNamed:(nullable NSString *)refName error:(NSError **)error; +- (GTCommit * _Nullable)createCommitWithTree:(GTTree *)tree message:(NSString *)message parents:(NSArray * _Nullable)parents updatingReferenceNamed:(NSString * _Nullable)refName error:(NSError **)error; @end diff --git a/ObjectiveGit/GTRepository+Private.h b/ObjectiveGit/GTRepository+Private.h index 194c3dc7f..f3341730c 100644 --- a/ObjectiveGit/GTRepository+Private.h +++ b/ObjectiveGit/GTRepository+Private.h @@ -12,8 +12,8 @@ NS_ASSUME_NONNULL_BEGIN @interface GTRepository () -- (nullable id)lookUpObjectByGitOid:(const git_oid *)oid objectType:(GTObjectType)type error:(NSError **)error; -- (nullable id)lookUpObjectByGitOid:(const git_oid *)oid error:(NSError **)error; +- (id _Nullable)lookUpObjectByGitOid:(const git_oid *)oid objectType:(GTObjectType)type error:(NSError **)error; +- (id _Nullable)lookUpObjectByGitOid:(const git_oid *)oid error:(NSError **)error; @end diff --git a/ObjectiveGit/GTRepository+Pull.h b/ObjectiveGit/GTRepository+Pull.h index 8af3b1cd7..cbc1f74fd 100644 --- a/ObjectiveGit/GTRepository+Pull.h +++ b/ObjectiveGit/GTRepository+Pull.h @@ -30,7 +30,7 @@ typedef void (^GTRemoteFetchTransferProgressBlock)(const git_transfer_progress * /// /// Returns YES if the pull was successful, NO otherwise (and `error`, if provided, /// will point to an error describing what happened). -- (BOOL)pullBranch:(GTBranch *)branch fromRemote:(GTRemote *)remote withOptions:(nullable NSDictionary *)options error:(NSError **)error progress:(nullable GTRemoteFetchTransferProgressBlock)progressBlock; +- (BOOL)pullBranch:(GTBranch *)branch fromRemote:(GTRemote *)remote withOptions:(NSDictionary * _Nullable)options error:(NSError **)error progress:(GTRemoteFetchTransferProgressBlock _Nullable)progressBlock; @end diff --git a/ObjectiveGit/GTRepository+References.h b/ObjectiveGit/GTRepository+References.h index 89ba93ca3..cfddac2fc 100644 --- a/ObjectiveGit/GTRepository+References.h +++ b/ObjectiveGit/GTRepository+References.h @@ -20,7 +20,7 @@ NS_ASSUME_NONNULL_BEGIN /// error - The error if one occurs. May be NULL. /// /// Returns the reference or nil if look up failed. -- (nullable GTReference *)lookUpReferenceWithName:(NSString *)name error:(NSError **)error; +- (GTReference * _Nullable)lookUpReferenceWithName:(NSString *)name error:(NSError **)error; @end diff --git a/ObjectiveGit/GTRepository+RemoteOperations.h b/ObjectiveGit/GTRepository+RemoteOperations.h index 86fbdfd0e..d93ebaad7 100644 --- a/ObjectiveGit/GTRepository+RemoteOperations.h +++ b/ObjectiveGit/GTRepository+RemoteOperations.h @@ -51,7 +51,7 @@ typedef NS_ENUM(NSInteger, GTFetchPruneOption) { /// /// Returns YES if the fetch was successful, NO otherwise (and `error`, if provided, /// will point to an error describing what happened). -- (BOOL)fetchRemote:(GTRemote *)remote withOptions:(nullable NSDictionary *)options error:(NSError **)error progress:(nullable void (^)(const git_transfer_progress *stats, BOOL *stop))progressBlock; +- (BOOL)fetchRemote:(GTRemote *)remote withOptions:(NSDictionary * _Nullable)options error:(NSError **)error progress:(void (^ _Nullable)(const git_transfer_progress *stats, BOOL *stop))progressBlock; /// Enumerate all available fetch head entries. /// @@ -85,7 +85,7 @@ typedef NS_ENUM(NSInteger, GTFetchPruneOption) { /// /// Returns YES if the push was successful, NO otherwise (and `error`, if provided, /// will point to an error describing what happened). -- (BOOL)pushBranch:(GTBranch *)branch toRemote:(GTRemote *)remote withOptions:(nullable NSDictionary *)options error:(NSError **)error progress:(nullable void (^)(unsigned int current, unsigned int total, size_t bytes, BOOL *stop))progressBlock; +- (BOOL)pushBranch:(GTBranch *)branch toRemote:(GTRemote *)remote withOptions:(NSDictionary * _Nullable)options error:(NSError **)error progress:(void (^ _Nullable)(unsigned int current, unsigned int total, size_t bytes, BOOL *stop))progressBlock; /// Push an array of branches to a remote. /// @@ -100,7 +100,7 @@ typedef NS_ENUM(NSInteger, GTFetchPruneOption) { /// /// Returns YES if the push was successful, NO otherwise (and `error`, if provided, /// will point to an error describing what happened). -- (BOOL)pushBranches:(NSArray *)branches toRemote:(GTRemote *)remote withOptions:(nullable NSDictionary *)options error:(NSError **)error progress:(nullable void (^)(unsigned int current, unsigned int total, size_t bytes, BOOL *stop))progressBlock; +- (BOOL)pushBranches:(NSArray *)branches toRemote:(GTRemote *)remote withOptions:(NSDictionary * _Nullable)options error:(NSError **)error progress:(void (^ _Nullable)(unsigned int current, unsigned int total, size_t bytes, BOOL *stop))progressBlock; /// Push a given Git notes reference name to a remote. /// @@ -114,7 +114,7 @@ typedef NS_ENUM(NSInteger, GTFetchPruneOption) { /// /// Returns YES if the push was successful, NO otherwise (and `error`, if provided, /// will point to an error describing what happened). -- (BOOL)pushNotes:(nullable NSString *)noteReferenceName toRemote:(GTRemote *)remote withOptions:(nullable NSDictionary *)options error:(NSError **)error progress:(nullable void (^)(unsigned int current, unsigned int total, size_t bytes, BOOL *stop))progressBlock; +- (BOOL)pushNotes:(NSString * _Nullable)noteReferenceName toRemote:(GTRemote *)remote withOptions:(NSDictionary * _Nullable)options error:(NSError **)error progress:(void (^ _Nullable)(unsigned int current, unsigned int total, size_t bytes, BOOL *stop))progressBlock; /// Delete a remote branch /// @@ -127,7 +127,7 @@ typedef NS_ENUM(NSInteger, GTFetchPruneOption) { /// /// Returns YES if the push was successful, NO otherwise (and `error`, if provided, /// will point to an error describing what happened). -- (BOOL)deleteBranch:(GTBranch *)branch fromRemote:(GTRemote *)remote withOptions:(nullable NSDictionary *)options error:(NSError **)error; +- (BOOL)deleteBranch:(GTBranch *)branch fromRemote:(GTRemote *)remote withOptions:(NSDictionary * _Nullable)options error:(NSError **)error; @end NS_ASSUME_NONNULL_END diff --git a/ObjectiveGit/GTRepository+Stashing.h b/ObjectiveGit/GTRepository+Stashing.h index 364d8a720..a7dc57b34 100644 --- a/ObjectiveGit/GTRepository+Stashing.h +++ b/ObjectiveGit/GTRepository+Stashing.h @@ -53,14 +53,14 @@ NS_ASSUME_NONNULL_BEGIN /// /// Returns a commit representing the stashed changes if successful, or nil /// otherwise. -- (nullable GTCommit *)stashChangesWithMessage:(nullable NSString *)message flags:(GTRepositoryStashFlag)flags error:(NSError **)error; +- (GTCommit * _Nullable)stashChangesWithMessage:(NSString * _Nullable)message flags:(GTRepositoryStashFlag)flags error:(NSError **)error; /// Enumerate over all the stashes in the repository, from most recent to oldest. /// /// block - A block to execute for each stash found. `index` will be the zero-based /// stash index (where 0 is the most recent stash). Setting `stop` to YES /// will cause enumeration to stop after the block returns. Must not be nil. -- (void)enumerateStashesUsingBlock:(void (^)(NSUInteger index, NSString * __nullable message, GTOID * __nullable oid, BOOL *stop))block; +- (void)enumerateStashesUsingBlock:(void (^)(NSUInteger index, NSString * _Nullable message, GTOID * _Nullable oid, BOOL *stop))block; /// Apply stashed changes. /// @@ -71,7 +71,7 @@ NS_ASSUME_NONNULL_BEGIN /// progressBlock - A block that will be executed on each step of the stash application. /// /// Returns YES if the requested stash was successfully applied, NO otherwise. -- (BOOL)applyStashAtIndex:(NSUInteger)index flags:(GTRepositoryStashApplyFlag)flags checkoutOptions:(nullable GTCheckoutOptions *)options error:(NSError **)error progressBlock:(nullable void (^)(GTRepositoryStashApplyProgress progress, BOOL *stop))progressBlock; +- (BOOL)applyStashAtIndex:(NSUInteger)index flags:(GTRepositoryStashApplyFlag)flags checkoutOptions:(GTCheckoutOptions * _Nullable)options error:(NSError **)error progressBlock:(void (^ _Nullable)(GTRepositoryStashApplyProgress progress, BOOL *stop))progressBlock; /// Pop stashed changes. /// @@ -82,7 +82,7 @@ NS_ASSUME_NONNULL_BEGIN /// progressBlock - A block that will be executed on each step of the stash application. /// /// Returns YES if the requested stash was successfully applied, NO otherwise. -- (BOOL)popStashAtIndex:(NSUInteger)index flags:(GTRepositoryStashApplyFlag)flags checkoutOptions:(nullable GTCheckoutOptions *)options error:(NSError **)error progressBlock:(nullable void (^)(GTRepositoryStashApplyProgress progress, BOOL *stop))progressBlock; +- (BOOL)popStashAtIndex:(NSUInteger)index flags:(GTRepositoryStashApplyFlag)flags checkoutOptions:(GTCheckoutOptions * _Nullable)options error:(NSError **)error progressBlock:(void (^ _Nullable)(GTRepositoryStashApplyProgress progress, BOOL *stop))progressBlock; /// Drop a stash from the repository's list of stashes. /// diff --git a/ObjectiveGit/GTRepository+Stashing.m b/ObjectiveGit/GTRepository+Stashing.m index 981a53d6f..e5903a87f 100644 --- a/ObjectiveGit/GTRepository+Stashing.m +++ b/ObjectiveGit/GTRepository+Stashing.m @@ -26,13 +26,13 @@ - (GTCommit *)stashChangesWithMessage:(NSString *)message flags:(GTRepositorySta if (error != NULL) *error = [NSError git_errorFor:gitError description:@"Failed to stash."]; return nil; } - + return [self lookUpObjectByGitOid:&git_oid error:error]; } static int stashEnumerationCallback(size_t index, const char *message, const git_oid *stash_id, void *payload) { GTRepositoryStashEnumerationBlock block = (__bridge GTRepositoryStashEnumerationBlock)payload; - + NSString *messageString = nil; if (message != NULL) messageString = @(message); @@ -40,13 +40,13 @@ static int stashEnumerationCallback(size_t index, const char *message, const git BOOL stop = NO; block(index, messageString, stashOID, &stop); - + return (stop ? GIT_EUSER : 0); } - (void)enumerateStashesUsingBlock:(GTRepositoryStashEnumerationBlock)block { NSParameterAssert(block != nil); - + git_stash_foreach(self.git_repository, &stashEnumerationCallback, (__bridge void *)block); } @@ -59,11 +59,11 @@ static int stashApplyProgressCallback(git_stash_apply_progress_t progress, void return (stop ? GIT_EUSER : 0); } -- (BOOL)applyStashAtIndex:(NSUInteger)index flags:(GTRepositoryStashApplyFlag)flags checkoutOptions:(GTCheckoutOptions *)options error:(NSError **)error progressBlock:(nullable void (^)(GTRepositoryStashApplyProgress progress, BOOL *stop))progressBlock { +- (BOOL)applyStashAtIndex:(NSUInteger)index flags:(GTRepositoryStashApplyFlag)flags checkoutOptions:(GTCheckoutOptions *)options error:(NSError **)error progressBlock:(void (^)(GTRepositoryStashApplyProgress progress, BOOL *stop))progressBlock { git_stash_apply_options stash_options = GIT_STASH_APPLY_OPTIONS_INIT; stash_options.flags = (git_stash_apply_flags)flags; - + if (progressBlock != nil) { stash_options.progress_cb = stashApplyProgressCallback; stash_options.progress_payload = (__bridge void *)progressBlock; @@ -81,7 +81,7 @@ - (BOOL)applyStashAtIndex:(NSUInteger)index flags:(GTRepositoryStashApplyFlag)fl return YES; } -- (BOOL)popStashAtIndex:(NSUInteger)index flags:(GTRepositoryStashApplyFlag)flags checkoutOptions:(GTCheckoutOptions *)options error:(NSError **)error progressBlock:(nullable void (^)(GTRepositoryStashApplyProgress progress, BOOL *stop))progressBlock{ +- (BOOL)popStashAtIndex:(NSUInteger)index flags:(GTRepositoryStashApplyFlag)flags checkoutOptions:(GTCheckoutOptions *)options error:(NSError **)error progressBlock:(void (^)(GTRepositoryStashApplyProgress progress, BOOL *stop))progressBlock { git_stash_apply_options stash_options = GIT_STASH_APPLY_OPTIONS_INIT; stash_options.flags = (git_stash_apply_flags)flags; diff --git a/ObjectiveGit/GTRepository+Status.h b/ObjectiveGit/GTRepository+Status.h index be12965da..86d4121ca 100644 --- a/ObjectiveGit/GTRepository+Status.h +++ b/ObjectiveGit/GTRepository+Status.h @@ -113,7 +113,7 @@ extern NSString *const GTRepositoryStatusOptionsPathSpecArrayKey; /// /// Returns `NO` in case of a failure or `YES` if the enumeration completed /// successfully. -- (BOOL)enumerateFileStatusWithOptions:(nullable NSDictionary *)options error:(NSError **)error usingBlock:(nullable void (^)(GTStatusDelta * __nullable headToIndex, GTStatusDelta * __nullable indexToWorkingDirectory, BOOL *stop))block; +- (BOOL)enumerateFileStatusWithOptions:(NSDictionary * _Nullable)options error:(NSError **)error usingBlock:(void (^ _Nullable)(GTStatusDelta * _Nullable headToIndex, GTStatusDelta * _Nullable indexToWorkingDirectory, BOOL *stop))block; /// Query the status of one file /// @@ -122,7 +122,7 @@ extern NSString *const GTRepositoryStatusOptionsPathSpecArrayKey; /// error - If not nil, set to any error that occurs. /// /// Returns the combined GTFileStatusFlags for the file. -- (GTFileStatusFlags)statusForFile:(NSString *)filePath success:(nullable BOOL *)success error:(NSError **)error; +- (GTFileStatusFlags)statusForFile:(NSString *)filePath success:(BOOL * _Nullable)success error:(NSError **)error; /// Tests the ignore rules to see if the file should be considered as ignored. /// @@ -131,7 +131,7 @@ extern NSString *const GTRepositoryStatusOptionsPathSpecArrayKey; /// error - If not nil, set to any error that occurs. /// /// Returns YES if the file should be ignored; NO otherwise. -- (BOOL)shouldFileBeIgnored:(NSURL *)fileURL success:(nullable BOOL *)success error:(NSError **)error; +- (BOOL)shouldFileBeIgnored:(NSURL *)fileURL success:(BOOL * _Nullable)success error:(NSError **)error; /// An enum for use with shouldIgnoreFileURL:error: below typedef NS_ENUM(NSInteger, GTFileIgnoreState) { diff --git a/ObjectiveGit/GTRepository.h b/ObjectiveGit/GTRepository.h index d9b099800..aa7debebf 100644 --- a/ObjectiveGit/GTRepository.h +++ b/ObjectiveGit/GTRepository.h @@ -84,7 +84,7 @@ extern NSString * const GTRepositoryCloneOptionsCredentialProvider; extern NSString * const GTRepositoryCloneOptionsCloneLocal; /// A NSURL pointing to a local file that contains PEM-encoded certificate chain. -extern NSString *const GTRepositoryCloneOptionsServerCertificateURL; +extern NSString * const GTRepositoryCloneOptionsServerCertificateURL; /// Repository extended open control flags for /// +initWithURL:flags:ceilingDirs:error:. @@ -154,9 +154,9 @@ typedef NS_ENUM(NSInteger, GTRepositoryStateType) { /// The file URL for the repository's working directory. /// Returns nil for a bare repository. -@property (nonatomic, readonly, strong, nullable) NSURL *fileURL; +@property (nonatomic, readonly, strong) NSURL * _Nullable fileURL; /// The file URL for the repository's .git directory. -@property (nonatomic, readonly, strong, nullable) NSURL *gitDirectoryURL; +@property (nonatomic, readonly, strong) NSURL * _Nullable gitDirectoryURL; /// Is this a bare repository (one without a working directory)? @property (nonatomic, readonly, getter = isBare) BOOL bare; @@ -178,7 +178,7 @@ typedef NS_ENUM(NSInteger, GTRepositoryStateType) { /// error - The error if one occurs. /// /// Returns the initialized repository, or nil if an error occurred. -+ (nullable instancetype)initializeEmptyRepositoryAtFileURL:(NSURL *)fileURL options:(nullable NSDictionary *)options error:(NSError **)error; ++ (instancetype _Nullable)initializeEmptyRepositoryAtFileURL:(NSURL *)fileURL options:(NSDictionary * _Nullable)options error:(NSError **)error; /// Convenience class initializer which uses the default options. /// @@ -186,7 +186,7 @@ typedef NS_ENUM(NSInteger, GTRepositoryStateType) { /// error - The error if one occurs. /// /// Returns the initialized repository, or nil if an error occurred. -+ (nullable instancetype)repositoryWithURL:(NSURL *)localFileURL error:(NSError **)error; ++ (instancetype _Nullable)repositoryWithURL:(NSURL *)localFileURL error:(NSError **)error; /// Convenience initializer which uses the default options. /// @@ -194,7 +194,7 @@ typedef NS_ENUM(NSInteger, GTRepositoryStateType) { /// error - The error if one occurs. /// /// Returns the initialized repository, or nil if an error occurred. -- (nullable instancetype)initWithURL:(NSURL *)localFileURL error:(NSError **)error; +- (instancetype _Nullable)initWithURL:(NSURL *)localFileURL error:(NSError **)error; /// Convenience initializer to find and open a repository with extended controls. /// @@ -205,7 +205,7 @@ typedef NS_ENUM(NSInteger, GTRepositoryStateType) { /// error - The error if one occurs. /// /// Returns the initialized repository, or nil if an error occurred. -- (nullable instancetype)initWithURL:(NSURL *)localFileURL flags:(NSInteger)flags ceilingDirs:(nullable NSArray *)ceilingDirURLs error:(NSError **)error; +- (instancetype _Nullable)initWithURL:(NSURL *)localFileURL flags:(NSInteger)flags ceilingDirs:(NSArray * _Nullable)ceilingDirURLs error:(NSError **)error; - (instancetype)init NS_UNAVAILABLE; @@ -216,7 +216,7 @@ typedef NS_ENUM(NSInteger, GTRepositoryStateType) { /// after this method is invoked. This must not be nil. /// /// Returns an initialized GTRepository, or nil if an erroe occurred. -- (nullable instancetype)initWithGitRepository:(git_repository *)repository NS_DESIGNATED_INITIALIZER; +- (instancetype _Nullable)initWithGitRepository:(git_repository *)repository NS_DESIGNATED_INITIALIZER; /// The underlying `git_repository` object. - (git_repository *)git_repository __attribute__((objc_returns_inner_pointer)); @@ -239,16 +239,16 @@ typedef NS_ENUM(NSInteger, GTRepositoryStateType) { /// May be NULL. /// /// returns nil (and fills the error parameter) if an error occurred, or a GTRepository object if successful. -+ (nullable instancetype)cloneFromURL:(NSURL *)originURL toWorkingDirectory:(NSURL *)workdirURL options:(nullable NSDictionary *)options error:(NSError **)error transferProgressBlock:(nullable void (^)(const git_transfer_progress *, BOOL *stop))transferProgressBlock; ++ (instancetype _Nullable)cloneFromURL:(NSURL *)originURL toWorkingDirectory:(NSURL *)workdirURL options:(NSDictionary * _Nullable)options error:(NSError **)error transferProgressBlock:(void (^ _Nullable)(const git_transfer_progress *, BOOL *stop))transferProgressBlock; /// Lookup objects in the repo by oid or sha1 -- (nullable id)lookUpObjectByOID:(GTOID *)oid objectType:(GTObjectType)type error:(NSError **)error; -- (nullable id)lookUpObjectByOID:(GTOID *)oid error:(NSError **)error; -- (nullable id)lookUpObjectBySHA:(NSString *)sha objectType:(GTObjectType)type error:(NSError **)error; -- (nullable id)lookUpObjectBySHA:(NSString *)sha error:(NSError **)error; +- (id _Nullable)lookUpObjectByOID:(GTOID *)oid objectType:(GTObjectType)type error:(NSError **)error; +- (id _Nullable)lookUpObjectByOID:(GTOID *)oid error:(NSError **)error; +- (id _Nullable)lookUpObjectBySHA:(NSString *)sha objectType:(GTObjectType)type error:(NSError **)error; +- (id _Nullable)lookUpObjectBySHA:(NSString *)sha error:(NSError **)error; /// Lookup an object in the repo using a revparse spec -- (nullable id)lookUpObjectByRevParse:(NSString *)spec error:(NSError **)error; +- (id _Nullable)lookUpObjectByRevParse:(NSString *)spec error:(NSError **)error; /// Finds the branch with the given name and type. /// @@ -262,7 +262,7 @@ typedef NS_ENUM(NSInteger, GTRepositoryStateType) { /// /// Returns the matching branch, or nil if no match was found or an error occurs. /// The latter two cases can be distinguished by checking `success`. -- (nullable GTBranch *)lookUpBranchWithName:(NSString *)branchName type:(GTBranchType)branchType success:(nullable BOOL *)success error:(NSError **)error; +- (GTBranch * _Nullable)lookUpBranchWithName:(NSString *)branchName type:(GTBranchType)branchType success:(BOOL * _Nullable)success error:(NSError **)error; /// List all references in the repository /// @@ -271,14 +271,14 @@ typedef NS_ENUM(NSInteger, GTRepositoryStateType) { /// /// returns an array of NSStrings holding the names of the references /// returns nil if an error occurred and fills the error parameter -- (nullable NSArray *)referenceNamesWithError:(NSError **)error; +- (NSArray * _Nullable)referenceNamesWithError:(NSError **)error; /// Get the HEAD reference. /// /// error - If not NULL, set to any error that occurs. /// /// Returns a GTReference or nil if an error occurs. -- (nullable GTReference *)headReferenceWithError:(NSError **)error; +- (GTReference * _Nullable)headReferenceWithError:(NSError **)error; /// Move HEAD reference safely, since deleting and recreating HEAD is always wrong. /// @@ -301,14 +301,14 @@ typedef NS_ENUM(NSInteger, GTRepositoryStateType) { /// error - If not NULL, set to any error that occurs. /// /// Returns an array of GTBranches or nil if an error occurs. -- (nullable NSArray *)localBranchesWithError:(NSError **)error; +- (NSArray * _Nullable)localBranchesWithError:(NSError **)error; /// Get the remote branches. /// /// error - If not NULL, set to any error that occurs. /// /// Returns an array of GTBranches or nil if an error occurs. -- (nullable NSArray *)remoteBranchesWithError:(NSError **)error; +- (NSArray * _Nullable)remoteBranchesWithError:(NSError **)error; /// Get branches with names sharing a given prefix. /// @@ -316,7 +316,7 @@ typedef NS_ENUM(NSInteger, GTRepositoryStateType) { /// error - If not NULL, set to any error that occurs. /// /// Returns an array of GTBranches or nil if an error occurs. -- (nullable NSArray *)branchesWithPrefix:(NSString *)prefix error:(NSError **)error; +- (NSArray * _Nullable)branchesWithPrefix:(NSString *)prefix error:(NSError **)error; /// Get the local and remote branches and merge them together by combining local /// branches with their remote branch, if they have one. @@ -324,21 +324,21 @@ typedef NS_ENUM(NSInteger, GTRepositoryStateType) { /// error - If not NULL, set to any error that occurs. /// /// Returns an array of GTBranches or nil if an error occurs. -- (nullable NSArray *)branches:(NSError **)error; +- (NSArray * _Nullable)branches:(NSError **)error; /// List all remotes in the repository /// /// error - will be filled if an error occurs /// /// returns an array of NSStrings holding the names of the remotes, or nil if an error occurred -- (nullable NSArray *)remoteNamesWithError:(NSError **)error; +- (NSArray * _Nullable)remoteNamesWithError:(NSError **)error; /// Get all tags in the repository. /// /// error - If not NULL, set to any error that occurs. /// /// Returns an array of GTTag or nil if an error occurs. -- (nullable NSArray *)allTagsWithError:(NSError **)error; +- (NSArray * _Nullable)allTagsWithError:(NSError **)error; /// Count all commits in the current branch (HEAD) /// @@ -356,7 +356,7 @@ typedef NS_ENUM(NSInteger, GTRepositoryStateType) { /// error - If not NULL, set to any error that occurs. /// /// Returns the created ref, or nil if an error occurred. -- (nullable GTReference *)createReferenceNamed:(NSString *)name fromOID:(GTOID *)targetOID message:(nullable NSString *)message error:(NSError **)error; +- (GTReference * _Nullable)createReferenceNamed:(NSString *)name fromOID:(GTOID *)targetOID message:(NSString * _Nullable)message error:(NSError **)error; /// Creates a symbolic reference to another ref. /// @@ -367,7 +367,7 @@ typedef NS_ENUM(NSInteger, GTRepositoryStateType) { /// error - If not NULL, set to any error that occurs. /// /// Returns the created ref, or nil if an error occurred. -- (nullable GTReference *)createReferenceNamed:(NSString *)name fromReference:(GTReference *)targetRef message:(nullable NSString *)message error:(NSError **)error; +- (GTReference * _Nullable)createReferenceNamed:(NSString *)name fromReference:(GTReference *)targetRef message:(NSString * _Nullable)message error:(NSError **)error; /// Create a new local branch pointing to the given OID. /// @@ -379,14 +379,14 @@ typedef NS_ENUM(NSInteger, GTRepositoryStateType) { /// error - If not NULL, set to any error that occurs. /// /// Returns the new branch, or nil if an error occurred. -- (nullable GTBranch *)createBranchNamed:(NSString *)name fromOID:(GTOID *)targetOID message:(nullable NSString *)message error:(NSError **)error; +- (GTBranch * _Nullable)createBranchNamed:(NSString *)name fromOID:(GTOID *)targetOID message:(NSString * _Nullable)message error:(NSError **)error; /// Get the current branch. /// /// error(out) - will be filled if an error occurs /// /// returns the current branch or nil if an error occurred. -- (nullable GTBranch *)currentBranchWithError:(NSError **)error; +- (GTBranch * _Nullable)currentBranchWithError:(NSError **)error; /// Find the commits that are on our local branch but not on the remote branch. /// @@ -394,7 +394,7 @@ typedef NS_ENUM(NSInteger, GTRepositoryStateType) { /// error(out) - will be filled if an error occurs /// /// returns the local commits, an empty array if there is no remote branch, or nil if an error occurred -- (nullable NSArray *)localCommitsRelativeToRemoteBranch:(GTBranch *)remoteBranch error:(NSError **)error; +- (NSArray * _Nullable)localCommitsRelativeToRemoteBranch:(GTBranch *)remoteBranch error:(NSError **)error; /// Retrieves git's "prepared message" for the next commit, like the default /// message pre-filled when committing after a conflicting merge. @@ -403,7 +403,7 @@ typedef NS_ENUM(NSInteger, GTRepositoryStateType) { /// /// Returns the message from disk, or nil if no prepared message exists or an /// error occurred. -- (nullable NSString *)preparedMessageWithError:(NSError **)error; +- (NSString * _Nullable)preparedMessageWithError:(NSError **)error; /// The signature for the user at the current time, based on the repository and /// system configs. If the user's name or email have not been set, reasonable @@ -420,7 +420,7 @@ typedef NS_ENUM(NSInteger, GTRepositoryStateType) { /// `error` will contain the error information. Setting `stop` to YES /// will cause enumeration to stop after the block returns. This must /// not be nil. -- (void)enumerateSubmodulesRecursively:(BOOL)recursive usingBlock:(void (^)(GTSubmodule * __nullable submodule, NSError *error, BOOL *stop))block; +- (void)enumerateSubmodulesRecursively:(BOOL)recursive usingBlock:(void (^)(GTSubmodule * _Nullable submodule, NSError *error, BOOL *stop))block; /// Looks up the top-level submodule with the given name. This will not recurse /// into submodule repositories. @@ -430,7 +430,7 @@ typedef NS_ENUM(NSInteger, GTRepositoryStateType) { /// /// Returns the first submodule that matches the given name, or nil if an error /// occurred locating or instantiating the GTSubmodule. -- (nullable GTSubmodule *)submoduleWithName:(NSString *)name error:(NSError **)error; +- (GTSubmodule * _Nullable)submoduleWithName:(NSString *)name error:(NSError **)error; /// Finds the merge base between the commits pointed at by the given OIDs. /// @@ -439,28 +439,28 @@ typedef NS_ENUM(NSInteger, GTRepositoryStateType) { /// error - If not NULL, set to any error that occurs. /// /// Returns the merge base, or nil if none is found or an error occurred. -- (nullable GTCommit *)mergeBaseBetweenFirstOID:(GTOID *)firstOID secondOID:(GTOID *)secondOID error:(NSError **)error; +- (GTCommit * _Nullable)mergeBaseBetweenFirstOID:(GTOID *)firstOID secondOID:(GTOID *)secondOID error:(NSError **)error; /// The object database backing the repository. /// /// error - The error if one occurred. /// /// Returns the object database, or nil if an error occurred. -- (nullable GTObjectDatabase *)objectDatabaseWithError:(NSError **)error; +- (GTObjectDatabase * _Nullable)objectDatabaseWithError:(NSError **)error; /// The configuration for the repository. /// /// error - The error if one occurred. /// /// Returns the configuration, or nil if an error occurred. -- (nullable GTConfiguration *)configurationWithError:(NSError **)error; +- (GTConfiguration * _Nullable)configurationWithError:(NSError **)error; /// The index for the repository. /// /// error - The error if one occurred. /// /// Returns the index, or nil if an error occurred. -- (nullable GTIndex *)indexWithError:(NSError **)error; +- (GTIndex * _Nullable)indexWithError:(NSError **)error; /// Creates a new lightweight tag in this repository. /// @@ -489,7 +489,7 @@ typedef NS_ENUM(NSInteger, GTRepositoryStateType) { /// May be NULL. /// /// Returns the object ID of the newly created tag or nil on error. -- (nullable GTOID *)OIDByCreatingTagNamed:(NSString *)tagName target:(GTObject *)theTarget tagger:(GTSignature *)theTagger message:(NSString *)theMessage error:(NSError **)error; +- (GTOID * _Nullable)OIDByCreatingTagNamed:(NSString *)tagName target:(GTObject *)theTarget tagger:(GTSignature *)theTagger message:(NSString *)theMessage error:(NSError **)error; /// Creates an annotated tag in this repo. Existing tags are not overwritten. /// @@ -505,7 +505,7 @@ typedef NS_ENUM(NSInteger, GTRepositoryStateType) { /// May be NULL. /// /// Returns the newly created tag or nil on error. -- (nullable GTTag *)createTagNamed:(NSString *)tagName target:(GTObject *)theTarget tagger:(GTSignature *)theTagger message:(NSString *)theMessage error:(NSError **)error; +- (GTTag * _Nullable)createTagNamed:(NSString *)tagName target:(GTObject *)theTarget tagger:(GTSignature *)theTagger message:(NSString *)theMessage error:(NSError **)error; /// Checkout a commit /// @@ -514,7 +514,7 @@ typedef NS_ENUM(NSInteger, GTRepositoryStateType) { /// error - The error if one occurred. Can be NULL. /// /// Returns YES if operation was successful, NO otherwise -- (BOOL)checkoutCommit:(GTCommit *)targetCommit options:(nullable GTCheckoutOptions *)options error:(NSError **)error; +- (BOOL)checkoutCommit:(GTCommit *)targetCommit options:(GTCheckoutOptions * _Nullable)options error:(NSError **)error; /// Checkout a reference /// @@ -523,7 +523,7 @@ typedef NS_ENUM(NSInteger, GTRepositoryStateType) { /// error - The error if one occurred. Can be NULL. /// /// Returns YES if operation was successful, NO otherwise -- (BOOL)checkoutReference:(GTReference *)targetReference options:(nullable GTCheckoutOptions *)options error:(NSError **)error; +- (BOOL)checkoutReference:(GTReference *)targetReference options:(GTCheckoutOptions * _Nullable)options error:(NSError **)error; /// Checkout an index /// @@ -532,7 +532,7 @@ typedef NS_ENUM(NSInteger, GTRepositoryStateType) { /// error - The error if one occurred. Can be NULL. /// /// Returns YES if operation was successful, NO otherwise -- (BOOL)checkoutIndex:(GTIndex *)index options:(nullable GTCheckoutOptions *)options error:(NSError **)error; +- (BOOL)checkoutIndex:(GTIndex *)index options:(GTCheckoutOptions * _Nullable)options error:(NSError **)error; /// Checkout a tree /// @@ -542,7 +542,7 @@ typedef NS_ENUM(NSInteger, GTRepositoryStateType) { /// /// Returns YES if operation was successful, NO otherwise /// Note: this operation will NOT update HEAD to newly checked out tree. -- (BOOL)checkoutTree:(GTTree *)targetTree options:(nullable GTCheckoutOptions *)options error:(NSError **)error; +- (BOOL)checkoutTree:(GTTree *)targetTree options:(GTCheckoutOptions * _Nullable)options error:(NSError **)error; /// Flush the gitattributes cache. - (void)flushAttributesCache; @@ -565,7 +565,7 @@ typedef NS_ENUM(NSInteger, GTRepositoryStateType) { /// Returns the loaded filter list, or nil if an error occurs or there are no /// filters to apply to the given path. The latter two cases can be /// distinguished using the value of `success`. -- (nullable GTFilterList *)filterListWithPath:(NSString *)path blob:(nullable GTBlob *)blob mode:(GTFilterSourceMode)mode options:(GTFilterListOptions)options success:(nullable BOOL *)success error:(NSError **)error; +- (GTFilterList * _Nullable)filterListWithPath:(NSString *)path blob:(GTBlob * _Nullable)blob mode:(GTFilterSourceMode)mode options:(GTFilterListOptions)options success:(BOOL * _Nullable)success error:(NSError **)error; /// Calculates how far ahead/behind the commit represented by `headOID` is, /// relative to the commit represented by `baseOID`. @@ -587,7 +587,7 @@ typedef NS_ENUM(NSInteger, GTRepositoryStateType) { /// error - The error if one occurred. /// /// Returns the enumerator or nil if an error occurred. -- (nullable GTEnumerator *)enumeratorForUniqueCommitsFromOID:(GTOID *)fromOID relativeToOID:(GTOID *)relativeOID error:(NSError **)error; +- (GTEnumerator * _Nullable)enumeratorForUniqueCommitsFromOID:(GTOID *)fromOID relativeToOID:(GTOID *)relativeOID error:(NSError **)error; /// Determines the status of a git repository--i.e., whether an operation /// (merge, cherry-pick, etc) is in progress. @@ -604,7 +604,7 @@ typedef NS_ENUM(NSInteger, GTRepositoryStateType) { /// error - The error if one occurred. /// /// Returns YES if operation was successful, NO otherwise -- (BOOL)cleanupStateWithError:(NSError **)error; +- (BOOL)cleanupStateWithError:(NSError * _Nullable __autoreleasing *)error; /// Creates a new note in this repo (using a default notes reference, e.g. "refs/notes/commits") /// @@ -620,7 +620,7 @@ typedef NS_ENUM(NSInteger, GTRepositoryStateType) { /// May be NULL. /// /// Returns the newly created note or nil on error. -- (nullable GTNote *)createNote:(NSString *)note target:(GTObject *)theTarget referenceName:(nullable NSString *)referenceName author:(GTSignature *)author committer:(GTSignature *)committer overwriteIfExists:(BOOL)overwrite error:(NSError **)error; +- (GTNote * _Nullable)createNote:(NSString *)note target:(GTObject *)theTarget referenceName:(NSString * _Nullable)referenceName author:(GTSignature *)author committer:(GTSignature *)committer overwriteIfExists:(BOOL)overwrite error:(NSError **)error; /// Removes a note attached to object in this repo /// @@ -634,7 +634,7 @@ typedef NS_ENUM(NSInteger, GTRepositoryStateType) { /// May be NULL. /// /// Returns the YES on success and NO on error. -- (BOOL)removeNoteFromObject:(GTObject *)parentObject referenceName:(nullable NSString *)referenceName author:(GTSignature *)author committer:(GTSignature *)committer error:(NSError **)error; +- (BOOL)removeNoteFromObject:(GTObject *)parentObject referenceName:(NSString * _Nullable)referenceName author:(GTSignature *)author committer:(GTSignature *)committer error:(NSError **)error; /// Enumerates through all stored notes in this repo /// @@ -646,7 +646,7 @@ typedef NS_ENUM(NSInteger, GTRepositoryStateType) { /// If the block sets `stop` to YES, the iterator is finished. /// /// Returns YES on overall success or NO on error of any kind. -- (BOOL)enumerateNotesWithReferenceName:(nullable NSString *)referenceName error:(NSError **)error usingBlock:(void (^)(GTNote * __nullable note, GTObject * __nullable object, NSError * __nullable error, BOOL *stop))block; +- (BOOL)enumerateNotesWithReferenceName:(NSString * _Nullable)referenceName error:(NSError **)error usingBlock:(void (^)(GTNote * _Nullable note, GTObject * _Nullable object, NSError * _Nullable error, BOOL *stop))block; @end diff --git a/ObjectiveGit/GTRepository.m b/ObjectiveGit/GTRepository.m index 1c4185ff5..5f9f2fb7b 100644 --- a/ObjectiveGit/GTRepository.m +++ b/ObjectiveGit/GTRepository.m @@ -242,7 +242,7 @@ static int remoteCreate(git_remote **remote, git_repository *repo, const char *n git_remote_callbacks remoteCallbacks; }; -+ (nullable instancetype)cloneFromURL:(NSURL *)originURL toWorkingDirectory:(NSURL *)workdirURL options:(nullable NSDictionary *)options error:(NSError **)error transferProgressBlock:(nullable void (^)(const git_transfer_progress *, BOOL *stop))transferProgressBlock { ++ (instancetype _Nullable)cloneFromURL:(NSURL *)originURL toWorkingDirectory:(NSURL *)workdirURL options:(NSDictionary * _Nullable)options error:(NSError **)error transferProgressBlock:(void (^ _Nullable)(const git_transfer_progress *, BOOL *stop))transferProgressBlock { git_clone_options cloneOptions = GIT_CLONE_OPTIONS_INIT; @@ -815,7 +815,7 @@ - (BOOL)moveHEADToCommit:(GTCommit *)commit error:(NSError **)error { return gitError == GIT_OK; } -- (BOOL)performCheckout:(GTObject *)target options:(nullable GTCheckoutOptions *)options error:(NSError **)error { +- (BOOL)performCheckout:(GTObject *)target options:(GTCheckoutOptions * _Nullable)options error:(NSError **)error { int gitError = git_checkout_tree(self.git_repository, target.git_object, options.git_checkoutOptions); if (gitError < GIT_OK) { if (error != NULL) *error = [NSError git_errorFor:gitError description:@"Failed to checkout tree."]; @@ -838,7 +838,7 @@ - (BOOL)checkoutReference:(GTReference *)targetReference options:(GTCheckoutOpti return [self moveHEADToReference:targetReference error:error]; } -- (BOOL)checkoutTree:(GTTree *)targetTree options:(nullable GTCheckoutOptions *)options error:(NSError **)error { +- (BOOL)checkoutTree:(GTTree *)targetTree options:(GTCheckoutOptions * _Nullable)options error:(NSError **)error { return [self performCheckout:targetTree options:options error:error]; } @@ -889,7 +889,7 @@ - (BOOL)calculateAhead:(size_t *)ahead behind:(size_t *)behind ofOID:(GTOID *)he return YES; } -- (nullable GTEnumerator *)enumeratorForUniqueCommitsFromOID:(GTOID *)fromOID relativeToOID:(GTOID *)relativeOID error:(NSError **)error { +- (GTEnumerator *)enumeratorForUniqueCommitsFromOID:(GTOID *)fromOID relativeToOID:(GTOID *)relativeOID error:(NSError **)error { NSParameterAssert(fromOID != nil); NSParameterAssert(relativeOID != nil); @@ -907,18 +907,18 @@ - (nullable GTEnumerator *)enumeratorForUniqueCommitsFromOID:(GTOID *)fromOID re - (BOOL)calculateState:(GTRepositoryStateType *)state withError:(NSError **)error { NSParameterAssert(state != NULL); - + int result = git_repository_state(self.git_repository); if (result < 0) { if (error != NULL) *error = [NSError git_errorFor:result description:@"Failed to calculate repository state"]; return NO; } - + *state = result; return YES; } -- (BOOL)cleanupStateWithError:(NSError * _Nullable __autoreleasing *)error { +- (BOOL)cleanupStateWithError:(NSError **)error { int errorCode = git_repository_state_cleanup(self.git_repository); if (errorCode != GIT_OK) { if (error != NULL) *error = [NSError git_errorFor:errorCode description:@"Failed to clean up repository state"]; @@ -930,14 +930,14 @@ - (BOOL)cleanupStateWithError:(NSError * _Nullable __autoreleasing *)error { - (GTNote *)createNote:(NSString *)note target:(GTObject *)theTarget referenceName:(NSString *)referenceName author:(GTSignature *)author committer:(GTSignature *)committer overwriteIfExists:(BOOL)overwrite error:(NSError **)error { git_oid oid; - + int gitError = git_note_create(&oid, self.git_repository, referenceName.UTF8String, author.git_signature, committer.git_signature, theTarget.OID.git_oid, [note UTF8String], overwrite ? 1 : 0); if (gitError != GIT_OK) { if (error != NULL) *error = [NSError git_errorFor:gitError description:@"Failed to create a note in repository"]; - + return nil; } - + return [[GTNote alloc] initWithTargetOID:theTarget.OID repository:self referenceName:referenceName error:error]; } @@ -947,48 +947,48 @@ - (BOOL)removeNoteFromObject:(GTObject *)parentObject referenceName:(NSString *) if (error != NULL) *error = [NSError git_errorFor:gitError description:@"Failed to delete note from %@", parentObject]; return NO; } - + return YES; } - (BOOL)enumerateNotesWithReferenceName:(NSString *)referenceName error:(NSError **)error usingBlock:(void (^)(GTNote *note, GTObject *object, NSError *error, BOOL *stop))block { git_note_iterator *iter = NULL; - + int gitError = git_note_iterator_new(&iter, self.git_repository, referenceName.UTF8String); - + if (gitError != GIT_OK) { if (error != NULL) *error = [NSError git_errorFor:gitError description:@"Failed to enumerate notes"]; return NO; } - + @onExit { git_note_iterator_free(iter); }; - + git_oid note_id; git_oid object_id; BOOL success = YES; int iterError = GIT_OK; - + while ((iterError = git_note_next(¬e_id, &object_id, iter)) == GIT_OK) { NSError *lookupErr = nil; - + GTNote *note = [[GTNote alloc] initWithTargetOID:[GTOID oidWithGitOid:&object_id] repository:self referenceName:referenceName error:&lookupErr]; GTObject *obj = nil; - + if (note != nil) obj = [self lookUpObjectByGitOid:&object_id error:&lookupErr]; - + BOOL stop = NO; block(note, obj, lookupErr, &stop); if (stop) { break; } } - + if (iterError != GIT_OK && iterError != GIT_ITEROVER) { if (error != NULL) *error = [NSError git_errorFor:iterError description:@"Iterator error"]; } - + return success; } diff --git a/ObjectiveGit/GTSignature.h b/ObjectiveGit/GTSignature.h index 910af1a5c..566fe1e8f 100644 --- a/ObjectiveGit/GTSignature.h +++ b/ObjectiveGit/GTSignature.h @@ -36,23 +36,23 @@ NS_ASSUME_NONNULL_BEGIN @interface GTSignature : NSObject /// The name of the person. -@property (nonatomic, readonly, copy, nullable) NSString *name; +@property (nonatomic, readonly, copy) NSString * _Nullable name; /// The email of the person. -@property (nonatomic, readonly, copy, nullable) NSString *email; +@property (nonatomic, readonly, copy) NSString * _Nullable email; /// The time when the action happened. -@property (nonatomic, readonly, strong, nullable) NSDate *time; +@property (nonatomic, readonly, strong) NSDate * _Nullable time; /// The time zone that `time` should be interpreted relative to. -@property (nonatomic, readonly, copy, nullable) NSTimeZone *timeZone; +@property (nonatomic, readonly, copy) NSTimeZone * _Nullable timeZone; /// Initializes the receiver with the given signature. /// /// git_signature - The signature to wrap. This must not be NULL. /// /// Returns an initialized GTSignature, or nil if an error occurs. -- (nullable instancetype)initWithGitSignature:(const git_signature *)git_signature; +- (instancetype _Nullable)initWithGitSignature:(const git_signature *)git_signature; /// Initializes the receiver with the given information. /// @@ -62,7 +62,7 @@ NS_ASSUME_NONNULL_BEGIN /// zone. This may be nil. /// /// Returns an initialized GTSignature, or nil if an error occurs. -- (nullable instancetype)initWithName:(NSString *)name email:(NSString *)email time:(nullable NSDate *)time; +- (instancetype _Nullable)initWithName:(NSString *)name email:(NSString *)email time:(NSDate * _Nullable)time; /// The underlying `git_signature` object. - (const git_signature *)git_signature __attribute__((objc_returns_inner_pointer)); diff --git a/ObjectiveGit/GTStatusDelta.h b/ObjectiveGit/GTStatusDelta.h index 433be3f3e..17299cba1 100644 --- a/ObjectiveGit/GTStatusDelta.h +++ b/ObjectiveGit/GTStatusDelta.h @@ -18,10 +18,10 @@ NS_ASSUME_NONNULL_BEGIN @interface GTStatusDelta : NSObject /// The file as it was prior to the change represented by this status delta. -@property (nonatomic, readonly, copy, nullable) GTDiffFile *oldFile; +@property (nonatomic, readonly, copy) GTDiffFile * _Nullable oldFile; /// The file after the change represented by this status delta -@property (nonatomic, readonly, copy, nullable) GTDiffFile *newFile __attribute__((ns_returns_not_retained)); +@property (nonatomic, readonly, copy) GTDiffFile * _Nullable newFile __attribute__((ns_returns_not_retained)); /// The status of the file. @property (nonatomic, readonly) GTDeltaType status; @@ -36,7 +36,7 @@ NS_ASSUME_NONNULL_BEGIN - (instancetype)init NS_UNAVAILABLE; /// Designated initializer. -- (nullable instancetype)initWithGitDiffDelta:(const git_diff_delta *)delta NS_DESIGNATED_INITIALIZER; +- (instancetype _Nullable)initWithGitDiffDelta:(const git_diff_delta *)delta NS_DESIGNATED_INITIALIZER; @end diff --git a/ObjectiveGit/GTSubmodule.h b/ObjectiveGit/GTSubmodule.h index dcade76fb..eabc37698 100644 --- a/ObjectiveGit/GTSubmodule.h +++ b/ObjectiveGit/GTSubmodule.h @@ -65,28 +65,28 @@ NS_ASSUME_NONNULL_BEGIN /// The OID that the submodule is pinned to in the parent repository's index. /// /// If the submodule is not in the index, this will be nil. -@property (nonatomic, strong, readonly, nullable) GTOID *indexOID; +@property (nonatomic, strong, readonly) GTOID * _Nullable indexOID; /// The OID that the submodule is pinned to in the parent repository's HEAD /// commit. /// /// If the submodule is not in HEAD, this will be nil. -@property (nonatomic, strong, readonly, nullable) GTOID *HEADOID; +@property (nonatomic, strong, readonly) GTOID * _Nullable HEADOID; /// The OID that is checked out in the submodule repository. /// /// If the submodule is not checked out, this will be nil. -@property (nonatomic, strong, readonly, nullable) GTOID *workingDirectoryOID; +@property (nonatomic, strong, readonly) GTOID * _Nullable workingDirectoryOID; /// The name of this submodule. -@property (nonatomic, copy, readonly, nullable) NSString *name; +@property (nonatomic, copy, readonly) NSString * _Nullable name; /// The path to this submodule, relative to its parent repository's root. -@property (nonatomic, copy, readonly, nullable) NSString *path; +@property (nonatomic, copy, readonly) NSString * _Nullable path; /// The remote URL provided for this submodule, read from the parent repository's /// `.git/config` or `.gitmodules` file. -@property (nonatomic, copy, readonly, nullable) NSString *URLString; +@property (nonatomic, copy, readonly) NSString * _Nullable URLString; - (instancetype)init NS_UNAVAILABLE; @@ -99,7 +99,7 @@ NS_ASSUME_NONNULL_BEGIN /// nil. /// /// Returns an initialized GTSubmodule, or nil if an error occurs. -- (nullable instancetype)initWithGitSubmodule:(git_submodule *)submodule parentRepository:(GTRepository *)repository NS_DESIGNATED_INITIALIZER; +- (instancetype _Nullable)initWithGitSubmodule:(git_submodule *)submodule parentRepository:(GTRepository *)repository NS_DESIGNATED_INITIALIZER; /// The underlying `git_submodule` object. - (git_submodule *)git_submodule __attribute__((objc_returns_inner_pointer)); @@ -119,7 +119,7 @@ NS_ASSUME_NONNULL_BEGIN /// error - The error if one occurred. /// /// Returns the updated submodule or nil if an error occurred. -- (nullable GTSubmodule *)submoduleByUpdatingIgnoreRule:(GTSubmoduleIgnoreRule)ignoreRule error:(NSError **)error; +- (GTSubmodule * _Nullable)submoduleByUpdatingIgnoreRule:(GTSubmoduleIgnoreRule)ignoreRule error:(NSError **)error; /// Synchronizes the submodule repository's configuration files with the settings /// from the parent repository. @@ -132,7 +132,7 @@ NS_ASSUME_NONNULL_BEGIN /// If the submodule is not currently checked out, this will fail. /// /// Returns the opened repository, or nil if an error occurs. -- (nullable GTRepository *)submoduleRepository:(NSError **)error; +- (GTRepository * _Nullable)submoduleRepository:(NSError **)error; /// Calls `-statusWithIgnoreRule:error:` with the submodule's ignore rule. - (GTSubmoduleStatus)status:(NSError **)error; diff --git a/ObjectiveGit/GTSubmodule.m b/ObjectiveGit/GTSubmodule.m index 93abf040e..8d70ea3e1 100644 --- a/ObjectiveGit/GTSubmodule.m +++ b/ObjectiveGit/GTSubmodule.m @@ -144,7 +144,7 @@ - (BOOL)sync:(NSError **)error { return YES; } -- (nullable GTRepository *)submoduleRepository:(NSError **)error { +- (GTRepository *)submoduleRepository:(NSError **)error { git_repository *repo; int gitError = git_submodule_open(&repo, self.git_submodule); if (gitError != GIT_OK) { diff --git a/ObjectiveGit/GTTag.h b/ObjectiveGit/GTTag.h index 3e452e83a..2b72bb526 100644 --- a/ObjectiveGit/GTTag.h +++ b/ObjectiveGit/GTTag.h @@ -37,7 +37,7 @@ NS_ASSUME_NONNULL_BEGIN @interface GTTag : GTObject {} /// The author of the tag. -@property (nonatomic, readonly, strong, nullable) GTSignature *tagger; +@property (nonatomic, readonly, strong) GTSignature * _Nullable tagger; /// The description given when the tag was created. @property (nonatomic, readonly, strong) NSString *message; @@ -46,7 +46,7 @@ NS_ASSUME_NONNULL_BEGIN @property (nonatomic, readonly, strong) NSString *name; /// The 'tagged' object. -@property (nonatomic, readonly, strong, nullable) GTObject *target; +@property (nonatomic, readonly, strong) GTObject * _Nullable target; /// The type of the 'tagged' object. @property (nonatomic, readonly) GTObjectType targetType; @@ -57,7 +57,7 @@ NS_ASSUME_NONNULL_BEGIN /// May be NULL. /// /// Returns the found object or nil on error. -- (nullable id)objectByPeelingTagError:(NSError **)error; +- (id _Nullable)objectByPeelingTagError:(NSError **)error; /// The underlying `git_object` as a `git_tag` object. - (git_tag *)git_tag __attribute__((objc_returns_inner_pointer)); diff --git a/ObjectiveGit/GTTree.h b/ObjectiveGit/GTTree.h index 3635e561a..80ceb507f 100644 --- a/ObjectiveGit/GTTree.h +++ b/ObjectiveGit/GTTree.h @@ -47,7 +47,7 @@ NS_ASSUME_NONNULL_BEGIN @property (nonatomic, readonly) NSUInteger entryCount; /// The contents of the tree, as an array of whose objects are of type `GTTreeEntry` -@property (nonatomic, strong, readonly, nullable) NSArray *entries; +@property (nonatomic, strong, readonly) NSArray * _Nullable entries; /// The underlying `git_object` as a `git_tree` object. - (git_tree *)git_tree __attribute__((objc_returns_inner_pointer)); @@ -57,21 +57,21 @@ NS_ASSUME_NONNULL_BEGIN /// index - index to retreive entry from /// /// returns a GTTreeEntry or nil if there is nothing at the index -- (nullable GTTreeEntry *)entryAtIndex:(NSUInteger)index; +- (GTTreeEntry * _Nullable)entryAtIndex:(NSUInteger)index; /// Get an entry by name /// /// name - the name of the entry /// /// returns a GTTreeEntry or nil if there is nothing with the specified name -- (nullable GTTreeEntry *)entryWithName:(NSString *)name; +- (GTTreeEntry * _Nullable)entryWithName:(NSString *)name; /// Get an entry by path /// /// path - the path of the entry relative to the repository root /// /// returns a GTTreeEntry or nil if there is nothing with the specified path -- (nullable GTTreeEntry *)entryWithPath:(NSString *)path error:(NSError **)error; +- (GTTreeEntry * _Nullable)entryWithPath:(NSString *)path error:(NSError **)error; /// Enumerates the contents of the tree /// @@ -98,7 +98,7 @@ NS_ASSUME_NONNULL_BEGIN /// /// Returns an index which represents the result of the merge, or nil if an error /// occurred. -- (nullable GTIndex *)merge:(GTTree *)otherTree ancestor:(nullable GTTree *)ancestorTree error:(NSError **)error; +- (GTIndex * _Nullable)merge:(GTTree *)otherTree ancestor:(GTTree * _Nullable)ancestorTree error:(NSError **)error; @end diff --git a/ObjectiveGit/GTTreeBuilder.h b/ObjectiveGit/GTTreeBuilder.h index 9daefb9d6..cfa5f8842 100644 --- a/ObjectiveGit/GTTreeBuilder.h +++ b/ObjectiveGit/GTTreeBuilder.h @@ -63,7 +63,7 @@ NS_ASSUME_NONNULL_BEGIN /// error - The error if one occurred. /// /// Returns the initialized object, or nil if an error occurred. -- (nullable instancetype)initWithTree:(nullable GTTree *)treeOrNil repository:(GTRepository *)repository error:(NSError **)error NS_DESIGNATED_INITIALIZER; +- (instancetype _Nullable)initWithTree:(GTTree * _Nullable)treeOrNil repository:(GTRepository *)repository error:(NSError **)error NS_DESIGNATED_INITIALIZER; /// The underlying `git_treebuilder` object. - (git_treebuilder *)git_treebuilder __attribute__((objc_returns_inner_pointer)); @@ -82,7 +82,7 @@ NS_ASSUME_NONNULL_BEGIN /// fileName - File name for the object in the index. Cannot be nil. /// /// Returns the matching entry or nil if it doesn't exist. -- (nullable GTTreeEntry *)entryWithFileName:(NSString *)fileName; +- (GTTreeEntry * _Nullable)entryWithFileName:(NSString *)fileName; /// Adds or updates the entry for the file name with the given data. When the /// tree is written, a blob will be inserted into the object database containing @@ -94,7 +94,7 @@ NS_ASSUME_NONNULL_BEGIN /// error - The error if one occurred. /// /// Returns the added entry, or nil if an error occurred -- (nullable GTTreeEntry *)addEntryWithData:(NSData *)data fileName:(NSString *)fileName fileMode:(GTFileMode)fileMode error:(NSError **)error; +- (GTTreeEntry * _Nullable)addEntryWithData:(NSData *)data fileName:(NSString *)fileName fileMode:(GTFileMode)fileMode error:(NSError **)error; /// Add or update an entry to the builder. /// @@ -111,7 +111,7 @@ NS_ASSUME_NONNULL_BEGIN /// the type of the pointed at object. /// /// Returns the added entry, or nil if an error occurred. -- (nullable GTTreeEntry *)addEntryWithOID:(GTOID *)oid fileName:(NSString *)fileName fileMode:(GTFileMode)fileMode error:(NSError **)error; +- (GTTreeEntry * _Nullable)addEntryWithOID:(GTOID *)oid fileName:(NSString *)fileName fileMode:(GTFileMode)fileMode error:(NSError **)error; /// Remove an entry from the builder by its file name. /// @@ -126,7 +126,7 @@ NS_ASSUME_NONNULL_BEGIN /// error - The error if one occurred. /// /// Returns the written tree, or nil if an error occurred. -- (nullable GTTree *)writeTree:(NSError **)error; +- (GTTree * _Nullable)writeTree:(NSError **)error; @end diff --git a/ObjectiveGit/GTTreeEntry.h b/ObjectiveGit/GTTreeEntry.h index 70e51e6a7..f90bc135a 100644 --- a/ObjectiveGit/GTTreeEntry.h +++ b/ObjectiveGit/GTTreeEntry.h @@ -36,16 +36,16 @@ NS_ASSUME_NONNULL_BEGIN @interface GTTreeEntry : NSObject /// Initializes the receiver. -- (nullable instancetype)initWithEntry:(const git_tree_entry *)theEntry parentTree:(nullable GTTree *)parent error:(NSError **)error; +- (instancetype _Nullable)initWithEntry:(const git_tree_entry *)theEntry parentTree:(GTTree * _Nullable)parent error:(NSError **)error; /// Convience class initializer. -+ (nullable instancetype)entryWithEntry:(const git_tree_entry *)theEntry parentTree:(nullable GTTree *)parent error:(NSError **)error; ++ (instancetype _Nullable)entryWithEntry:(const git_tree_entry *)theEntry parentTree:(GTTree * _Nullable)parent error:(NSError **)error; /// The underlying `git_tree_entry`. - (git_tree_entry *)git_tree_entry __attribute__((objc_returns_inner_pointer)); /// The entry's parent tree. This may be nil if nil parentTree is passed in to -initWithEntry: -@property (nonatomic, strong, readonly, nullable) GTTree *tree; +@property (nonatomic, strong, readonly) GTTree * _Nullable tree; /// The filename of the entry @property (nonatomic, copy, readonly) NSString *name; @@ -54,28 +54,28 @@ NS_ASSUME_NONNULL_BEGIN @property (nonatomic, readonly) NSInteger attributes; /// The SHA hash of the entry -@property (nonatomic, copy, readonly, nullable) NSString *SHA; +@property (nonatomic, copy, readonly) NSString * _Nullable SHA; /// The type of GTObject that -object: will return. @property (nonatomic, readonly) GTObjectType type; /// The OID of the entry. -@property (nonatomic, strong, readonly, nullable) GTOID *OID; +@property (nonatomic, strong, readonly) GTOID * _Nullable OID; /// Convert the entry into an GTObject /// /// error - will be filled if an error occurs /// /// Returns this entry as a GTObject or nil if an error occurred. -- (nullable GTObject *)GTObject:(NSError **)error; +- (GTObject * _Nullable)GTObject:(NSError **)error; @end @interface GTObject (GTTreeEntry) -+ (nullable instancetype)objectWithTreeEntry:(GTTreeEntry *)treeEntry error:(NSError **)error; -- (nullable instancetype)initWithTreeEntry:(GTTreeEntry *)treeEntry error:(NSError **)error; ++ (instancetype _Nullable)objectWithTreeEntry:(GTTreeEntry *)treeEntry error:(NSError **)error; +- (instancetype _Nullable)initWithTreeEntry:(GTTreeEntry *)treeEntry error:(NSError **)error; @end diff --git a/ObjectiveGitTests/GTRepositoryStashingSpec.m b/ObjectiveGitTests/GTRepositoryStashingSpec.m index 75a51a328..e3e7ffc29 100644 --- a/ObjectiveGitTests/GTRepositoryStashingSpec.m +++ b/ObjectiveGitTests/GTRepositoryStashingSpec.m @@ -158,7 +158,7 @@ BOOL success = NO; __block NSUInteger lastStashIndex = 0; - [repository enumerateStashesUsingBlock:^(NSUInteger index, NSString * __nullable message, GTOID * __nullable oid, BOOL * __nonnull stop) { + [repository enumerateStashesUsingBlock:^(NSUInteger index, NSString * _Nullable message, GTOID * _Nullable oid, BOOL * _Nonnull stop) { lastStashIndex = index; }];