From 8449a34c0eb48f61c78451d900d8f97b0524eb7b Mon Sep 17 00:00:00 2001 From: Etienne Samson Date: Tue, 31 May 2016 18:42:31 +0200 Subject: [PATCH] Add pathspec support to GTCheckoutOptions --- ObjectiveGit/GTCheckoutOptions.h | 3 +++ ObjectiveGit/GTCheckoutOptions.m | 3 +++ 2 files changed, 6 insertions(+) diff --git a/ObjectiveGit/GTCheckoutOptions.h b/ObjectiveGit/GTCheckoutOptions.h index 6ab8f6b3d..3c63855a0 100644 --- a/ObjectiveGit/GTCheckoutOptions.h +++ b/ObjectiveGit/GTCheckoutOptions.h @@ -58,6 +58,9 @@ typedef NS_OPTIONS(NSInteger, GTCheckoutNotifyFlags) { @property (assign) GTCheckoutNotifyFlags notifyFlags; @property (copy) int (^notifyBlock)(GTCheckoutNotifyFlags why, NSString *path, GTDiffFile *baseline, GTDiffFile *target, GTDiffFile *workdir); + +@property (copy) NSArray *pathSpecs; + @end NS_ASSUME_NONNULL_END \ No newline at end of file diff --git a/ObjectiveGit/GTCheckoutOptions.m b/ObjectiveGit/GTCheckoutOptions.m index 8106a579f..f4c18ed5e 100644 --- a/ObjectiveGit/GTCheckoutOptions.m +++ b/ObjectiveGit/GTCheckoutOptions.m @@ -9,6 +9,7 @@ #import "GTCheckoutOptions.h" #import "GTDiffFile.h" #import "NSError+Git.h" +#import "NSArray+StringArray.h" #import "git2.h" // The type of block set in progressBlock for progress reporting @@ -91,6 +92,8 @@ - (git_checkout_options *)git_checkoutOptions { _git_checkoutOptions.notify_payload = (__bridge void *)self.notifyBlock; } + _git_checkoutOptions.paths = self.pathSpecs.git_strarray; + return &_git_checkoutOptions; }