@@ -22,6 +22,9 @@ extern NSString *const GTRepositoryRemoteOptionsFetchPrune;
2222// / A `GTRemoteAutoTagOption`, that will be used to determine how the fetch should handle tags.
2323extern NSString *const GTRepositoryRemoteOptionsDownloadTags;
2424
25+ // / A `@(BOOL)`, indicating git notes should also be pushed to the default notes reference name (if `@(YES)`), or an `NSArray(NSString)` containing reference names to be pushed through.
26+ extern NSString *const GTRepositoryRemoteOptionsPushNotes;
27+
2528// / An enum describing the data needed for pruning.
2629// / See `git_fetch_prune_t`.
2730typedef NS_ENUM (NSInteger , GTFetchPruneOption) {
@@ -76,6 +79,7 @@ typedef NS_ENUM(NSInteger, GTFetchPruneOption) {
7679// / options - Options applied to the push operation. Can be NULL.
7780// / Recognized options are:
7881// / `GTRepositoryRemoteOptionsCredentialProvider`
82+ // / `GTRepositoryRemoteOptionsPushNotes` (to push together with notes in one push)
7983// / error - The error if one occurred. Can be NULL.
8084// / progressBlock - An optional callback for monitoring progress. May be NULL.
8185// /
@@ -89,34 +93,15 @@ typedef NS_ENUM(NSInteger, GTFetchPruneOption) {
8993// / remote - The remote to push to. Must not be nil.
9094// / options - Options applied to the push operation. Can be NULL.
9195// / Recognized options are:
92- // / `GTRepositoryRemoteOptionsCredentialProvider`
96+ // / `GTRepositoryRemoteOptionsCredentialProvider`,
97+ // / `GTRepositoryRemoteOptionsPushNotes` (to push together with notes in one push)
9398// / error - The error if one occurred. Can be NULL.
9499// / progressBlock - An optional callback for monitoring progress. May be NULL.
95100// /
96101// / Returns YES if the push was successful, NO otherwise (and `error`, if provided,
97102// / will point to an error describing what happened).
98103- (BOOL )pushBranches : (NSArray <GTBranch *> *)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;
99104
100- // / Push an array of branches to a remote, together with notes (in one push).
101- // / Normally, if you use Git notes functionality, to push the notes to remote, you would have to
102- // / do two operations: pushBranches followed by pushNotes. This is unrational, so we offer you a handy
103- // / shortcut that allows to push the branches together with the notes.
104- // /
105- // / branches - An array of branches to push. Must not be nil.
106- // / remote - The remote to push to. Must not be nil.
107- // / options - Options applied to the push operation. Can be NULL.
108- // / Recognized options are:
109- // / `GTRepositoryRemoteOptionsCredentialProvider`
110- // / referenceName - Reference name for notes, if they should be pushed together with the branches.
111- // / Use +[GTNote defaultReferenceNameWithError:] to push the default note reference.
112- // / Passing NULL here will make notes NOT to be pushed.
113- // / error - The error if one occurred. Can be NULL.
114- // / progressBlock - An optional callback for monitoring progress. May be NULL.
115- // /
116- // / Returns YES if the push was successful, NO otherwise (and `error`, if provided,
117- // / will point to an error describing what happened).
118- - (BOOL )pushBranches : (NSArray <GTBranch *> *)branches toRemote : (GTRemote *)remote withOptions : (nullable NSDictionary *)options withNotesReferenceName : (nullable NSString *)notesReferenceName error : (NSError **)error progress : (nullable void (^)(unsigned int current, unsigned int total, size_t bytes, BOOL *stop))progressBlock;
119-
120105// / Push a given Git notes reference name to a remote.
121106// /
122107// / noteReferenceName - Name of the notes reference. If NULL, will default to whatever the default is (e.g. "refs/notes/commits")
0 commit comments