- Detect and route jj repositories alongside git - Thread VCS kind through status and UI labels - Add jj driver contract coverage and shared freshness helper
Showing the changes to packages (3 of 30 files). Show all
Unified · Split
| @@ -1,6 +1,7 @@ | |||
| 1 | import { Schema } from "effect"; | 1 | import { Schema } from "effect"; |
| 2 | import { NonNegativeInt, PositiveInt, ThreadId, TrimmedNonEmptyString } from "./baseSchemas.ts"; | 2 | import { NonNegativeInt, PositiveInt, ThreadId, TrimmedNonEmptyString } from "./baseSchemas.ts"; |
| 3 | import { SourceControlProviderError, SourceControlProviderInfo } from "./sourceControl.ts"; | 3 | import { SourceControlProviderError, SourceControlProviderInfo } from "./sourceControl.ts"; |
| 4 | import { VcsDriverKind } from "./vcs.ts"; | ||
| 4 | 5 | ||
| 5 | const TrimmedNonEmptyStringSchema = TrimmedNonEmptyString; | 6 | const TrimmedNonEmptyStringSchema = TrimmedNonEmptyString; |
| 6 | const GIT_LIST_BRANCHES_MAX_LIMIT = 200; | 7 | const GIT_LIST_BRANCHES_MAX_LIMIT = 200; |
| @@ -194,6 +195,7 @@ const VcsStatusChangeRequest = Schema.Struct({ · 187 unmodified lines | |||
| 194 | }); | 195 | }); |
| 195 | 196 | ||
| 196 | const VcsStatusLocalShape = { | 197 | const VcsStatusLocalShape = { |
| 198 | kind: VcsDriverKind, | ||
| 197 | isRepo: Schema.Boolean, | 199 | isRepo: Schema.Boolean, |
| 198 | sourceControlProvider: Schema.optional(SourceControlProviderInfo), | 200 | sourceControlProvider: Schema.optional(SourceControlProviderInfo), |
| 199 | hasPrimaryRemote: Schema.Boolean, | 201 | hasPrimaryRemote: Schema.Boolean, |
| @@ -81,6 +81,7 @@ describe("applyGitStatusStreamEvent", () => { · 80 unmodified lines | |||
| 81 | }; | 81 | }; |
| 82 | 82 | ||
| 83 | expect(applyGitStatusStreamEvent(null, { _tag: "remoteUpdated", remote })).toEqual({ | 83 | expect(applyGitStatusStreamEvent(null, { _tag: "remoteUpdated", remote })).toEqual({ |
| 84 | kind: "unknown", | ||
| 84 | isRepo: true, | 85 | isRepo: true, |
| 85 | hasPrimaryRemote: false, | 86 | hasPrimaryRemote: false, |
| 86 | isDefaultRef: false, | 87 | isDefaultRef: false, |
| @@ -96,6 +97,7 @@ describe("applyGitStatusStreamEvent", () => { · 9 unmodified lines | |||
| 96 | 97 | ||
| 97 | it("preserves local-only fields when applying a remote update", () => { | 98 | it("preserves local-only fields when applying a remote update", () => { |
| 98 | const current: VcsStatusResult = { | 99 | const current: VcsStatusResult = { |
| 100 | kind: "git", | ||
| 99 | isRepo: true, | 101 | isRepo: true, |
| 100 | sourceControlProvider: { | 102 | sourceControlProvider: { |
| 101 | kind: "github", | 103 | kind: "github", |
| @@ -226,6 +226,7 @@ function toRemoteStatusPart(status: VcsStatusResult): VcsStatusRemoteResult { · 225 unmodified lines | |||
| 226 | 226 | ||
| 227 | function toLocalStatusPart(status: VcsStatusResult): VcsStatusLocalResult { | 227 | function toLocalStatusPart(status: VcsStatusResult): VcsStatusLocalResult { |
| 228 | return { | 228 | return { |
| 229 | kind: status.kind, | ||
| 229 | isRepo: status.isRepo, | 230 | isRepo: status.isRepo, |
| 230 | ...(status.sourceControlProvider | 231 | ...(status.sourceControlProvider |
| 231 | ? { sourceControlProvider: status.sourceControlProvider } | 232 | ? { sourceControlProvider: status.sourceControlProvider } |
| @@ -251,6 +252,7 @@ export function applyGitStatusStreamEvent( · 19 unmodified lines | |||
| 251 | if (current === null) { | 252 | if (current === null) { |
| 252 | return mergeGitStatusParts( | 253 | return mergeGitStatusParts( |
| 253 | { | 254 | { |
| 255 | kind: "unknown", | ||
| 254 | isRepo: true, | 256 | isRepo: true, |
| 255 | hasPrimaryRemote: false, | 257 | hasPrimaryRemote: false, |
| 256 | isDefaultRef: false, | 258 | isDefaultRef: false, |