Skip to content

Commit a2da134

Browse files
committed
[swift_snapshot_tool] Use <= instead of < then when determining the tag to use for the date.
Otherwise, if one knows the specific date one wants to use, one always uses the tag before it which is annoying.
1 parent c8dbbc3 commit a2da134

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

utils/swift_snapshot_tool/Sources/swift_snapshot_tool/bisect_toolchains.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ struct BisectToolchains: AsyncParsableCommand {
9595
// just say 50 toolchains ago. To get a few weeks worth. This is easier than
9696
// writing dates a lot.
9797
let oldDateAsDate = self.oldDateAsDate
98-
guard let goodTagIndex = tags.firstIndex(where: { $0.tag.date(branch: self.branch) < oldDateAsDate }) else {
98+
guard let goodTagIndex = tags.firstIndex(where: { $0.tag.date(branch: self.branch) <= oldDateAsDate }) else {
9999
log("Failed to find tag with date: \(oldDateAsDate)")
100100
fatalError()
101101
}

utils/swift_snapshot_tool/Sources/swift_snapshot_tool/run_toolchain.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ struct RunToolchains: AsyncParsableCommand {
8080
let tags = try! await getTagsFromSwiftRepo(branch: branch)
8181

8282
let date = self.dateAsDate
83-
guard var tagIndex = tags.firstIndex(where: { $0.tag.date(branch: self.branch) < date }) else {
83+
guard var tagIndex = tags.firstIndex(where: { $0.tag.date(branch: self.branch) <= date }) else {
8484
log("Failed to find tag with date: \(date)")
8585
fatalError()
8686
}

0 commit comments

Comments
 (0)