···11import Foundation
2233/// Protocol for running jj commands. Abstracted for testability.
44-protocol JujutsuCommandRunner: Sendable {
44+protocol JujutsuCommandRunner {
55 /// Run a jj command with the given arguments against a repository.
66 ///
77 /// - Parameters:
+3-3
Sources/HomeManagerStatus/RepoStatus.swift
···11import SwiftUI
2233/// Represents the current status of the jj repository relative to trunk().
44-struct RepoStatus: Equatable, Sendable {
44+struct RepoStatus: Equatable {
55 /// Number of commits on the current working copy ancestry that are not on trunk().
66 let ahead: Int
77 /// Number of commits on trunk() that are not on the current working copy ancestry.
···16161717 // MARK: - Convenience initializers
18181919- static func synced(dirty: Bool = false, at date: Date = .now) -> RepoStatus {
1919+ static func synced(dirty: Bool = false, at date: Date = Date()) -> RepoStatus {
2020 RepoStatus(ahead: 0, behind: 0, dirty: dirty, error: nil, checkedAt: date)
2121 }
22222323- static func error(_ message: String, at date: Date = .now) -> RepoStatus {
2323+ static func error(_ message: String, at date: Date = Date()) -> RepoStatus {
2424 RepoStatus(ahead: 0, behind: 0, dirty: false, error: message, checkedAt: date)
2525 }
2626
+3-3
Sources/HomeManagerStatus/StatusChecker.swift
···2222 self.status = RepoStatus(
2323 ahead: 0, behind: 0, dirty: false,
2424 error: "Not yet checked",
2525- checkedAt: .now
2525+ checkedAt: Date()
2626 )
2727 }
2828···3434 // Then schedule periodic checks
3535 timer = Timer.scheduledTimer(withTimeInterval: refreshInterval, repeats: true) {
3636 [weak self] _ in
3737- guard let self else { return }
3737+ guard let self = self else { return }
3838 Task { @MainActor in
3939 await self.refresh()
4040 }
···49495050 /// Perform a single status check.
5151 func refresh() async {
5252- let now = Date.now
5252+ let now = Date()
53535454 do {
5555 async let aheadOutput = runner.run(
+1-1
Sources/HomeManagerStatus/StatusParser.swift
···4444 aheadOutput: String,
4545 behindOutput: String,
4646 dirtyOutput: String,
4747- at date: Date = .now
4747+ at date: Date = Date()
4848 ) -> RepoStatus {
4949 let ahead = parseCommitCount(from: aheadOutput)
5050 let behind = parseCommitCount(from: behindOutput)