@@ -59,7 +59,7 @@ static int stashApplyProgressCallback(git_stash_apply_progress_t progress, void
5959 return (stop ? GIT_EUSER : 0 );
6060}
6161
62- - (BOOL )applyStashAtIndex : (NSUInteger )index popStash : (BOOL )pop flags : (GTRepositoryStashApplyFlag)flags error : (NSError **)error progressBlock : (nullable void (^)(GTRepositoryStashApplyProgress, BOOL * __nonnull))progressBlock {
62+ - (BOOL )applyStashAtIndex : (NSUInteger )index popStash : (BOOL )pop flags : (GTRepositoryStashApplyFlag)flags checkoutOptions : (nullable GTCheckoutOptions *) options error : (NSError **)error progressBlock : (nullable void (^)(GTRepositoryStashApplyProgress, BOOL * __nonnull))progressBlock {
6363 git_stash_apply_options stash_options = GIT_STASH_APPLY_OPTIONS_INIT ;
6464
6565 stash_options.flags = (git_stash_apply_flags)flags;
@@ -68,6 +68,10 @@ - (BOOL)applyStashAtIndex:(NSUInteger)index popStash:(BOOL)pop flags:(GTReposito
6868 stash_options.progress_payload = (__bridge void *)progressBlock;
6969 }
7070
71+ if (options != nil ) {
72+ stash_options.checkout_options = *options.git_checkoutOptions ;
73+ }
74+
7175 if (pop == NO ) {
7276 int gitError = git_stash_apply (self.git_repository , index, &stash_options);
7377 if (gitError != GIT_OK ) {
@@ -84,12 +88,12 @@ - (BOOL)applyStashAtIndex:(NSUInteger)index popStash:(BOOL)pop flags:(GTReposito
8488 return YES ;
8589}
8690
87- - (BOOL )applyStashAtIndex : (NSUInteger )index flags : (GTRepositoryStashApplyFlag)flags error : (NSError **)error progressBlock : (nullable void (^)(GTRepositoryStashApplyProgress progress, BOOL *stop))progressBlock {
88- return [self applyStashAtIndex: index popStash: NO flags: flags error: error progressBlock: progressBlock];
91+ - (BOOL )applyStashAtIndex : (NSUInteger )index flags : (GTRepositoryStashApplyFlag)flags checkoutOptions : (nullable GTCheckoutOptions *) options error : (NSError **)error progressBlock : (nullable void (^)(GTRepositoryStashApplyProgress progress, BOOL *stop))progressBlock {
92+ return [self applyStashAtIndex: index popStash: NO flags: flags checkoutOptions: options error: error progressBlock: progressBlock];
8993}
9094
91- - (BOOL )popStashAtIndex : (NSUInteger )index flags : (GTRepositoryStashApplyFlag)flags error : (NSError **)error progressBlock : (nullable void (^)(GTRepositoryStashApplyProgress progress, BOOL *stop))progressBlock {
92- return [self applyStashAtIndex: index popStash: YES flags: flags error: error progressBlock: progressBlock];
95+ - (BOOL )popStashAtIndex : (NSUInteger )index flags : (GTRepositoryStashApplyFlag)flags checkoutOptions : (nullable GTCheckoutOptions *) options error : (NSError **)error progressBlock : (nullable void (^)(GTRepositoryStashApplyProgress progress, BOOL *stop))progressBlock {
96+ return [self applyStashAtIndex: index popStash: YES flags: flags checkoutOptions: options error: error progressBlock: progressBlock];
9397}
9498
9599- (BOOL )dropStashAtIndex : (NSUInteger )index error : (NSError **)error {
0 commit comments