File tree Expand file tree Collapse file tree 2 files changed +23
-2
lines changed Expand file tree Collapse file tree 2 files changed +23
-2
lines changed Original file line number Diff line number Diff line change @@ -126,9 +126,12 @@ - (BOOL)shouldFileBeIgnored:(NSURL *)fileURL success:(BOOL *)success error:(NSEr
126126}
127127
128128- (GTFileIgnoreState)shouldIgnoreFileURL : (NSURL *)fileURL error : (NSError **)error {
129- BOOL success = false ;
129+ BOOL success = NO ;
130130 BOOL ignore = [self shouldFileBeIgnored: fileURL success: &success error: error];
131- return ignore && success ? GTFileIgnoreStateShouldIgnore : (!ignore && success ? GTFileIgnoreStateShouldNotIgnore : GTFileIgnoreStateIgnoreCheckFailed);
131+ if (success) {
132+ return (ignore ? GTFileIgnoreStateShouldIgnore : GTFileIgnoreStateShouldNotIgnore);
133+ }
134+ return GTFileIgnoreStateIgnoreCheckFailed;
132135}
133136
134137@end
Original file line number Diff line number Diff line change 105105 expect (@(enumerationSuccessful)).to (beTruthy ());
106106 expect (err).to (beNil ());
107107 });
108+
109+ it (@" should report file should be ignored" , ^{
110+ __block NSError *err = nil ;
111+ NSURL *fileURL = [repository.fileURL URLByAppendingPathComponent: @" .DS_Store" ];
112+ BOOL success = NO ;
113+ BOOL shouldIgnore = [repository shouldFileBeIgnored: fileURL success: &success error: &err];
114+ expect (@(success)).to (beTrue ());
115+ expect (@(shouldIgnore)).to (beTrue ());
116+ expect (err).to (beNil ());
117+ });
118+
119+ it (@" should report file should be ignored (convenience wrapper)" , ^{
120+ __block NSError *err = nil ;
121+ NSURL *fileURL = [repository.fileURL URLByAppendingPathComponent: @" .DS_Store" ];
122+ GTFileIgnoreState ignore = [repository shouldIgnoreFileURL: fileURL error: &err];
123+ expect (@(ignore)).to (equal (@(GTFileIgnoreStateShouldIgnore)));
124+ expect (err).to (beNil ());
125+ });
108126});
109127
110128afterEach (^{
You can’t perform that action at this time.
0 commit comments