Skip to content

Commit 544e01e

Browse files
committed
Use explicit comparisons
1 parent 2961b7c commit 544e01e

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

Classes/GTRepository+Status.m

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -99,12 +99,12 @@ - (GTFileStatusFlags)statusForFile:(NSURL *)fileURL success:(BOOL *)success erro
9999

100100
int gitError = git_status_file(&status, self.git_repository, fileURL.path.fileSystemRepresentation);
101101
if (gitError != GIT_OK) {
102-
if (error) *error = [NSError git_errorFor:gitError description:@"Status failed" failureReason:@"Failed to get status for file \"%@\" in \"%@\"", fileURL.path, self.gitDirectoryURL];
103-
if (success) *success = NO;
102+
if (error != nil) *error = [NSError git_errorFor:gitError description:@"Status failed" failureReason:@"Failed to get status for file \"%@\" in \"%@\"", fileURL.path, self.gitDirectoryURL];
103+
if (success != nil) *success = NO;
104104
return GTFileStatusCurrent;
105105
}
106106

107-
if (success) *success = YES;
107+
if (success != nil) *success = YES;
108108
return (GTFileStatusFlags)status;
109109
}
110110

@@ -115,12 +115,12 @@ - (BOOL)shouldFileBeIgnored:(NSURL *)fileURL success:(BOOL *)success error:(NSEr
115115

116116
int gitError = git_status_should_ignore(&ignoreState, self.git_repository, fileURL.path.fileSystemRepresentation);
117117
if (gitError != GIT_OK) {
118-
if (error) *error = [NSError git_errorFor:gitError description:@"Ignore failed" failureReason:@"Failed to get ignore status for file \"%@\" in \"%@\"", fileURL.path, self.gitDirectoryURL];
119-
if (success) *success = NO;
118+
if (error != nil) *error = [NSError git_errorFor:gitError description:@"Ignore failed" failureReason:@"Failed to get ignore status for file \"%@\" in \"%@\"", fileURL.path, self.gitDirectoryURL];
119+
if (success != nil) *success = NO;
120120
return YES;
121121
}
122122

123-
if (success) *success = YES;
123+
if (success != nil) *success = YES;
124124
return (ignoreState == 0 ? YES : NO);
125125
}
126126

0 commit comments

Comments
 (0)