@@ -150,6 +150,20 @@ extern NSString * const GTRepositoryInitOptionsInitialHEAD;
150
150
// / initialization.
151
151
extern NSString * const GTRepositoryInitOptionsOriginURLString;
152
152
153
+ // / The possible states for the repository to be in, based on the current ongoing operation.
154
+ typedef NS_ENUM (NSInteger , GTRepositoryStateType) {
155
+ GTRepositoryStateNone = GIT_REPOSITORY_STATE_NONE,
156
+ GTRepositoryStateMerge = GIT_REPOSITORY_STATE_MERGE,
157
+ GTRepositoryStateRevert = GIT_REPOSITORY_STATE_REVERT,
158
+ GTRepositoryStateCherryPick = GIT_REPOSITORY_STATE_CHERRYPICK,
159
+ GTRepositoryStateBisect = GIT_REPOSITORY_STATE_BISECT,
160
+ GTRepositoryStateRebase = GIT_REPOSITORY_STATE_REBASE,
161
+ GTRepositoryStateRebaseInteractive = GIT_REPOSITORY_STATE_REBASE_INTERACTIVE,
162
+ GTRepositoryStateRebaseMerge = GIT_REPOSITORY_STATE_REBASE_MERGE,
163
+ GTRepositoryStateApplyMailbox = GIT_REPOSITORY_STATE_APPLY_MAILBOX,
164
+ GTRepositoryStateApplyMailboxOrRebase = GIT_REPOSITORY_STATE_APPLY_MAILBOX_OR_REBASE,
165
+ };
166
+
153
167
@interface GTRepository : NSObject
154
168
155
169
// / The file URL for the repository's working directory.
@@ -573,6 +587,23 @@ extern NSString * const GTRepositoryInitOptionsOriginURLString;
573
587
// / Returns the enumerator or nil if an error occurred.
574
588
- (nullable GTEnumerator *)enumeratorForUniqueCommitsFromOID : (GTOID *)fromOID relativeToOID : (GTOID *)relativeOID error : (NSError **)error ;
575
589
590
+ // / Determines the status of a git repository--i.e., whether an operation
591
+ // / (merge, cherry-pick, etc) is in progress.
592
+ // /
593
+ // / state - A pointer to set the retrieved state. Must not be NULL.
594
+ // / error - The error if one occurred.
595
+ // /
596
+ // / Returns YES if operation was successful, NO otherwise
597
+ - (BOOL )calculateState : (GTRepositoryStateType *)state withError : (NSError **)error ;
598
+
599
+ // / Remove all the metadata associated with an ongoing command like merge,
600
+ // / revert, cherry-pick, etc. For example: MERGE_HEAD, MERGE_MSG, etc.
601
+ // /
602
+ // / error - The error if one occurred.
603
+ // /
604
+ // / Returns YES if operation was successful, NO otherwise
605
+ - (BOOL )cleanupStateWithError : (NSError **)error ;
606
+
576
607
@end
577
608
578
609
NS_ASSUME_NONNULL_END
0 commit comments