1313// / A `GTCredentialProvider`, that will be used to authenticate against the remote.
1414extern NSString *const GTRepositoryRemoteOptionsCredentialProvider;
1515
16+ NS_ASSUME_NONNULL_BEGIN
17+
1618@interface GTRepository (RemoteOperations)
1719
1820#pragma mark - Fetch
1921
2022// / Fetch a remote.
2123// /
22- // / remote - The remote to fetch from.
23- // / options - Options applied to the fetch operation.
24+ // / remote - The remote to fetch from. Must not be nil.
25+ // / options - Options applied to the fetch operation. May be nil.
2426// / Recognized options are :
2527// / `GTRepositoryRemoteOptionsCredentialProvider`
2628// / error - The error if one occurred. Can be NULL.
29+ // / progressBlock - Optional callback to receive fetch progress stats during the
30+ // / transfer. May be nil.
2731// /
2832// / Returns YES if the fetch was successful, NO otherwise (and `error`, if provided,
2933// / will point to an error describing what happened).
30- - (BOOL )fetchRemote : (GTRemote *)remote withOptions : (NSDictionary *)options error : (NSError **)error progress : (void (^)(const git_transfer_progress *stats, BOOL *stop))progressBlock ;
34+ - (BOOL )fetchRemote : (GTRemote *)remote withOptions : (nullable NSDictionary *)options error : (NSError **)error progress : (nullable void (^)(const git_transfer_progress *stats, BOOL *stop))progressBlock;
3135
3236// / Enumerate all available fetch head entries.
3337// /
3438// / error - The error if one ocurred. Can be NULL.
35- // / block - A block to execute for each FETCH_HEAD entry. `fetchHeadEntry` will be the current
36- // / fetch head entry. Setting `stop` to YES will cause enumeration to stop after the block returns.
39+ // / block - A block to execute for each FETCH_HEAD entry. `fetchHeadEntry` will
40+ // / be the current fetch head entry. Setting `stop` to YES will cause
41+ // / enumeration to stop after the block returns. Must not be nil.
3742// /
3843// / Returns YES if the operation succedded, NO otherwise.
3944- (BOOL )enumerateFetchHeadEntriesWithError : (NSError **)error usingBlock : (void (^)(GTFetchHeadEntry *fetchHeadEntry, BOOL *stop))block ;
@@ -42,7 +47,7 @@ extern NSString *const GTRepositoryRemoteOptionsCredentialProvider;
4247// /
4348// / error - The error if one ocurred. Can be NULL.
4449// /
45- // / Retruns an array with GTFetchHeadEntry objects
50+ // / Retruns a (possibly empty) array with GTFetchHeadEntry objects. Will not be nil.
4651- (NSArray *)fetchHeadEntriesWithError : (NSError **)error ;
4752
4853#pragma mark - Push
@@ -55,11 +60,11 @@ extern NSString *const GTRepositoryRemoteOptionsCredentialProvider;
5560// / Recognized options are:
5661// / `GTRepositoryRemoteOptionsCredentialProvider`
5762// / error - The error if one occurred. Can be NULL.
58- // / progressBlock - An optional callback for monitoring progress.
63+ // / progressBlock - An optional callback for monitoring progress. May be NULL.
5964// /
6065// / Returns YES if the push was successful, NO otherwise (and `error`, if provided,
6166// / will point to an error describing what happened).
62- - (BOOL )pushBranch : (GTBranch *)branch toRemote : (GTRemote *)remote withOptions : (NSDictionary *)options error : (NSError **)error progress : (void (^)(unsigned int current, unsigned int total, size_t bytes, BOOL *stop))progressBlock ;
67+ - (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;
6368
6469// / Push an array of branches to a remote.
6570// /
@@ -69,10 +74,12 @@ extern NSString *const GTRepositoryRemoteOptionsCredentialProvider;
6974// / Recognized options are:
7075// / `GTRepositoryRemoteOptionsCredentialProvider`
7176// / error - The error if one occurred. Can be NULL.
72- // / progressBlock - An optional callback for monitoring progress.
77+ // / progressBlock - An optional callback for monitoring progress. May be NULL.
7378// /
7479// / Returns YES if the push was successful, NO otherwise (and `error`, if provided,
7580// / will point to an error describing what happened).
76- - (BOOL )pushBranches : (NSArray *)branches toRemote : (GTRemote *)remote withOptions : (NSDictionary *)options error : (NSError **)error progress : (void (^)(unsigned int current, unsigned int total, size_t bytes, BOOL *stop))progressBlock ;
81+ - (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;
7782
7883@end
84+
85+ NS_ASSUME_NONNULL_END
0 commit comments