Skip to content

Commit 405c296

Browse files
committed
[SE-0121] remove more uses of optional < operator
1 parent d43a1a4 commit 405c296

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Sources/Get/Git.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ extension Git {
3636
url, dstdir.asString, environment: env, message: "Cloning \(url)")
3737
} catch POSIX.Error.exitStatus {
3838
// Git 2.0 or higher is required
39-
if Git.majorVersionNumber < 2 {
39+
if let majorVersion = Git.majorVersionNumber, majorVersion < 2 {
4040
throw Utility.Error.obsoleteGitVersion
4141
} else {
4242
throw Error.gitCloneFailure(url, dstdir.asString)

Sources/SourceControl/GitRepository.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public class GitRepositoryProvider: RepositoryProvider {
5757
environment: env, message: "Cloning \(repository.url)")
5858
} catch POSIX.Error.exitStatus {
5959
// Git 2.0 or higher is required
60-
if Git.majorVersionNumber < 2 {
60+
if let majorVersion = Git.majorVersionNumber, majorVersion < 2 {
6161
throw Utility.Error.obsoleteGitVersion
6262
} else {
6363
throw GitRepositoryProviderError.gitCloneFailure(url: repository.url, path: path)

0 commit comments

Comments
 (0)