File tree Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -133,6 +133,16 @@ extern NSString *const GTRepositoryStatusOptionsPathSpecArrayKey;
133
133
// / Returns YES if the file should be ignored; NO otherwise.
134
134
- (BOOL )shouldFileBeIgnored : (NSURL *)fileURL success : (nullable BOOL *)success error : (NSError **)error ;
135
135
136
+ // / An enum for use with shouldIgnoreFileURL:error: below
137
+ typedef NS_ENUM (NSInteger , GTFileIgnoreState) {
138
+ GTFileIgnoreStateIgnoreCheckFailed = -1 ,
139
+ GTFileIgnoreStateShouldNotIgnore = 0 ,
140
+ GTFileIgnoreStateShouldIgnore = 1
141
+ };
142
+
143
+ // / Convenience wrapper for shouldFileBeIgnored:success:error:
144
+ - (GTFileIgnoreState)shouldIgnoreFileURL : (NSURL *)fileURL error : (NSError **)error ;
145
+
136
146
@end
137
147
138
148
NS_ASSUME_NONNULL_END
Original file line number Diff line number Diff line change @@ -125,4 +125,10 @@ - (BOOL)shouldFileBeIgnored:(NSURL *)fileURL success:(BOOL *)success error:(NSEr
125
125
return (ignoreState == 1 ? YES : NO );
126
126
}
127
127
128
+ - (GTFileIgnoreState)shouldIgnoreFileURL : (NSURL *)fileURL error : (NSError **)error {
129
+ BOOL success = false ;
130
+ BOOL ignore = [self shouldFileBeIgnored: fileURL success: &success error: error];
131
+ return ignore && success ? GTFileIgnoreStateShouldIgnore : (!ignore && success ? GTFileIgnoreStateShouldNotIgnore : GTFileIgnoreStateIgnoreCheckFailed);
132
+ }
133
+
128
134
@end
You can’t perform that action at this time.
0 commit comments