@scolladon/tsgit 1.0.0 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (138) hide show
  1. package/README.md +116 -1
  2. package/dist/cjs/adapters/browser/index.cjs +1 -1
  3. package/dist/cjs/adapters/browser/index.cjs.map +1 -1
  4. package/dist/cjs/adapters/memory/index.cjs +1 -1
  5. package/dist/cjs/adapters/memory/index.cjs.map +1 -1
  6. package/dist/cjs/adapters/node/index.cjs +1 -1
  7. package/dist/cjs/adapters/node/index.cjs.map +1 -1
  8. package/dist/cjs/chunks/{browser-http-transport-BBF8uw-f.cjs → browser-http-transport-DcG05jw3.cjs} +2 -2
  9. package/dist/cjs/chunks/{browser-http-transport-BBF8uw-f.cjs.map → browser-http-transport-DcG05jw3.cjs.map} +1 -1
  10. package/dist/cjs/chunks/context-BcoAzPuU.cjs.map +1 -1
  11. package/dist/cjs/chunks/error-CqLvhejR.cjs +2 -0
  12. package/dist/cjs/chunks/error-CqLvhejR.cjs.map +1 -0
  13. package/dist/cjs/chunks/index-BcxdLkNe.cjs +2 -0
  14. package/dist/cjs/chunks/index-BcxdLkNe.cjs.map +1 -0
  15. package/dist/cjs/chunks/index-D5Nd-Mks.cjs +2 -0
  16. package/dist/cjs/chunks/index-D5Nd-Mks.cjs.map +1 -0
  17. package/dist/cjs/chunks/{logger-Cz9r6yt5.cjs → logger-C8Z5BfFF.cjs} +2 -2
  18. package/dist/cjs/chunks/{logger-Cz9r6yt5.cjs.map → logger-C8Z5BfFF.cjs.map} +1 -1
  19. package/dist/cjs/chunks/memory-http-transport-Pjyme5KN.cjs +2 -0
  20. package/dist/cjs/chunks/memory-http-transport-Pjyme5KN.cjs.map +1 -0
  21. package/dist/cjs/chunks/node-http-transport-UkW5eEm3.cjs +2 -0
  22. package/dist/cjs/chunks/node-http-transport-UkW5eEm3.cjs.map +1 -0
  23. package/dist/cjs/chunks/{progress-CK7CT9vU.cjs → progress-CntEbiuo.cjs} +2 -2
  24. package/dist/cjs/chunks/{progress-CK7CT9vU.cjs.map → progress-CntEbiuo.cjs.map} +1 -1
  25. package/dist/cjs/chunks/readable-stream-MTA6D0Zh.cjs +2 -0
  26. package/dist/cjs/chunks/readable-stream-MTA6D0Zh.cjs.map +1 -0
  27. package/dist/cjs/chunks/repository-B_jx2AKW.cjs +2 -0
  28. package/dist/cjs/chunks/repository-B_jx2AKW.cjs.map +1 -0
  29. package/dist/cjs/commands/index.cjs +1 -1
  30. package/dist/cjs/index.browser.cjs +1 -1
  31. package/dist/cjs/index.browser.cjs.map +1 -1
  32. package/dist/cjs/index.cjs +1 -1
  33. package/dist/cjs/index.default.cjs +1 -1
  34. package/dist/cjs/index.default.cjs.map +1 -1
  35. package/dist/cjs/index.node.cjs +1 -1
  36. package/dist/cjs/index.node.cjs.map +1 -1
  37. package/dist/cjs/operators/index.cjs +1 -1
  38. package/dist/cjs/operators/index.cjs.map +1 -1
  39. package/dist/cjs/primitives/index.cjs +1 -1
  40. package/dist/cjs/primitives/index.cjs.map +1 -1
  41. package/dist/cjs/transport/index.cjs.map +1 -1
  42. package/dist/esm/adapters/browser/index.js +1 -1
  43. package/dist/esm/adapters/browser/index.js.map +1 -1
  44. package/dist/esm/adapters/memory/index.js +1 -1
  45. package/dist/esm/adapters/memory/index.js.map +1 -1
  46. package/dist/esm/adapters/node/index.js +1 -1
  47. package/dist/esm/adapters/node/index.js.map +1 -1
  48. package/dist/esm/chunks/{browser-http-transport-mZQKkInJ.js → browser-http-transport-COFgnEyq.js} +2 -2
  49. package/dist/esm/chunks/{browser-http-transport-mZQKkInJ.js.map → browser-http-transport-COFgnEyq.js.map} +1 -1
  50. package/dist/esm/chunks/context-CumKOV7K.js.map +1 -1
  51. package/dist/esm/chunks/error-BN9rdQ33.js +2 -0
  52. package/dist/esm/chunks/error-BN9rdQ33.js.map +1 -0
  53. package/dist/esm/chunks/index-BdV37p4e.js +2 -0
  54. package/dist/esm/chunks/index-BdV37p4e.js.map +1 -0
  55. package/dist/esm/chunks/index-BkRJ9-Im.js +2 -0
  56. package/dist/esm/chunks/index-BkRJ9-Im.js.map +1 -0
  57. package/dist/esm/chunks/{logger-84ixEPbQ.js → logger-BLZbLzva.js} +2 -2
  58. package/dist/esm/chunks/{logger-84ixEPbQ.js.map → logger-BLZbLzva.js.map} +1 -1
  59. package/dist/esm/chunks/memory-http-transport-DRYdYgiE.js +2 -0
  60. package/dist/esm/chunks/memory-http-transport-DRYdYgiE.js.map +1 -0
  61. package/dist/esm/chunks/node-http-transport-Bp5cFZCt.js +2 -0
  62. package/dist/esm/chunks/node-http-transport-Bp5cFZCt.js.map +1 -0
  63. package/dist/esm/chunks/{progress-OTDhgmPO.js → progress-DJU_f66N.js} +2 -2
  64. package/dist/esm/chunks/{progress-OTDhgmPO.js.map → progress-DJU_f66N.js.map} +1 -1
  65. package/dist/esm/chunks/readable-stream-CGuf8k1J.js +2 -0
  66. package/dist/esm/chunks/readable-stream-CGuf8k1J.js.map +1 -0
  67. package/dist/esm/chunks/repository-DiagDiT_.js +2 -0
  68. package/dist/esm/chunks/repository-DiagDiT_.js.map +1 -0
  69. package/dist/esm/commands/index.js +1 -1
  70. package/dist/esm/index.browser.js +1 -1
  71. package/dist/esm/index.browser.js.map +1 -1
  72. package/dist/esm/index.default.js +1 -1
  73. package/dist/esm/index.default.js.map +1 -1
  74. package/dist/esm/index.js +1 -1
  75. package/dist/esm/index.node.js +1 -1
  76. package/dist/esm/index.node.js.map +1 -1
  77. package/dist/esm/operators/index.js +1 -1
  78. package/dist/esm/operators/index.js.map +1 -1
  79. package/dist/esm/primitives/index.js +1 -1
  80. package/dist/esm/primitives/index.js.map +1 -1
  81. package/dist/esm/transport/index.js.map +1 -1
  82. package/dist/types/adapters/browser/index.d.cts +1 -1
  83. package/dist/types/adapters/browser/index.d.ts +1 -1
  84. package/dist/types/adapters/memory/index.d.cts +3 -1
  85. package/dist/types/adapters/memory/index.d.ts +3 -1
  86. package/dist/types/adapters/node/index.d.cts +116 -2
  87. package/dist/types/adapters/node/index.d.ts +116 -2
  88. package/dist/types/chunks/{context-d36639-i.d.cts → context-D84z1i5F.d.cts} +36 -18
  89. package/dist/types/chunks/{context-CTaXSPiP.d.ts → context-o5TPfMB2.d.ts} +36 -18
  90. package/dist/types/chunks/{diff-change-B09vxnxy.d.cts → diff-change-Bm1zvVsC.d.cts} +1 -1
  91. package/dist/types/chunks/{diff-change-D7xSeCn9.d.ts → diff-change-alGRzD_j.d.ts} +1 -1
  92. package/dist/types/chunks/{repository-CFT9j9H6.d.cts → repository-23evW2h-.d.cts} +4 -3
  93. package/dist/types/chunks/{repository-ntg7eXb2.d.ts → repository-BT7Xq1kJ.d.ts} +4 -3
  94. package/dist/types/chunks/write-tree-DNjhjS3t.d.ts +282 -0
  95. package/dist/types/chunks/write-tree-DVp0RJ_r.d.cts +282 -0
  96. package/dist/types/commands/index.d.cts +81 -35
  97. package/dist/types/commands/index.d.ts +81 -35
  98. package/dist/types/index.browser.d.cts +4 -4
  99. package/dist/types/index.browser.d.ts +4 -4
  100. package/dist/types/index.d.cts +3 -3
  101. package/dist/types/index.d.ts +3 -3
  102. package/dist/types/index.default.d.cts +4 -4
  103. package/dist/types/index.default.d.ts +4 -4
  104. package/dist/types/index.node.d.cts +4 -4
  105. package/dist/types/index.node.d.ts +4 -4
  106. package/dist/types/operators/index.d.cts +17 -1
  107. package/dist/types/operators/index.d.ts +17 -1
  108. package/dist/types/primitives/index.d.cts +223 -186
  109. package/dist/types/primitives/index.d.ts +223 -186
  110. package/package.json +37 -9
  111. package/dist/cjs/chunks/error-DL4SHCBJ.cjs +0 -2
  112. package/dist/cjs/chunks/error-DL4SHCBJ.cjs.map +0 -1
  113. package/dist/cjs/chunks/error-DN8Vnwr4.cjs +0 -2
  114. package/dist/cjs/chunks/error-DN8Vnwr4.cjs.map +0 -1
  115. package/dist/cjs/chunks/index-iUd-bwwm.cjs +0 -2
  116. package/dist/cjs/chunks/index-iUd-bwwm.cjs.map +0 -1
  117. package/dist/cjs/chunks/memory-http-transport-DGll7Af4.cjs +0 -2
  118. package/dist/cjs/chunks/memory-http-transport-DGll7Af4.cjs.map +0 -1
  119. package/dist/cjs/chunks/merge-base-DlGWnkxP.cjs +0 -2
  120. package/dist/cjs/chunks/merge-base-DlGWnkxP.cjs.map +0 -1
  121. package/dist/cjs/chunks/node-http-transport-CuOgJlws.cjs +0 -2
  122. package/dist/cjs/chunks/node-http-transport-CuOgJlws.cjs.map +0 -1
  123. package/dist/cjs/chunks/repository-Cfo6Bj8T.cjs +0 -2
  124. package/dist/cjs/chunks/repository-Cfo6Bj8T.cjs.map +0 -1
  125. package/dist/esm/chunks/error-CnIcr6IG.js +0 -2
  126. package/dist/esm/chunks/error-CnIcr6IG.js.map +0 -1
  127. package/dist/esm/chunks/error-DTEP18A3.js +0 -2
  128. package/dist/esm/chunks/error-DTEP18A3.js.map +0 -1
  129. package/dist/esm/chunks/index-CJc-SKMj.js +0 -2
  130. package/dist/esm/chunks/index-CJc-SKMj.js.map +0 -1
  131. package/dist/esm/chunks/memory-http-transport-BmHjaEWj.js +0 -2
  132. package/dist/esm/chunks/memory-http-transport-BmHjaEWj.js.map +0 -1
  133. package/dist/esm/chunks/merge-base-DmuOYxfP.js +0 -2
  134. package/dist/esm/chunks/merge-base-DmuOYxfP.js.map +0 -1
  135. package/dist/esm/chunks/node-http-transport-Bz3noIS3.js +0 -2
  136. package/dist/esm/chunks/node-http-transport-Bz3noIS3.js.map +0 -1
  137. package/dist/esm/chunks/repository-qcX3-LkP.js +0 -2
  138. package/dist/esm/chunks/repository-qcX3-LkP.js.map +0 -1
@@ -1,217 +1,254 @@
1
- import { O as ObjectId, d as FilePath, b as Context, R as RefName } from '../chunks/context-CTaXSPiP.js';
2
- import { A as AuthorIdentity, F as FileMode, T as TreeDiff } from '../chunks/diff-change-D7xSeCn9.js';
3
- import '../chunks/http-transport-DirKfK2S.js';
4
-
5
- interface Blob {
6
- readonly type: 'blob';
7
- readonly id: ObjectId;
8
- readonly content: Uint8Array;
9
- }
10
-
11
- interface ExtraHeader {
12
- readonly key: string;
13
- readonly value: string;
14
- }
15
- interface CommitData {
16
- readonly tree: ObjectId;
17
- readonly parents: ReadonlyArray<ObjectId>;
18
- readonly author: AuthorIdentity;
19
- readonly committer: AuthorIdentity;
20
- readonly message: string;
21
- readonly gpgSignature?: string;
22
- readonly extraHeaders: ReadonlyArray<ExtraHeader>;
23
- }
24
- interface Commit {
25
- readonly type: 'commit';
26
- readonly id: ObjectId;
27
- readonly data: CommitData;
28
- }
29
-
30
- type ObjectType = 'blob' | 'tree' | 'commit' | 'tag';
31
-
32
- interface TagData {
33
- readonly object: ObjectId;
34
- readonly objectType: ObjectType;
35
- readonly tagName: string;
36
- readonly tagger?: AuthorIdentity;
37
- readonly message: string;
38
- readonly gpgSignature?: string;
39
- readonly extraHeaders: ReadonlyArray<ExtraHeader>;
40
- }
41
- interface Tag {
42
- readonly type: 'tag';
43
- readonly id: ObjectId;
44
- readonly data: TagData;
45
- }
46
-
47
- interface TreeEntry {
48
- readonly mode: FileMode;
49
- readonly name: string;
50
- readonly id: ObjectId;
51
- }
52
- interface Tree {
53
- readonly type: 'tree';
54
- readonly id: ObjectId;
55
- readonly entries: ReadonlyArray<TreeEntry>;
56
- }
57
-
58
- type GitObject = Blob | Tree | Commit | Tag;
59
-
60
- interface IndexEntryFlags {
61
- readonly assumeValid: boolean;
62
- readonly extended: boolean;
63
- readonly stage: 0 | 1 | 2 | 3;
64
- }
65
- interface IndexEntry {
66
- readonly ctimeSeconds: number;
67
- readonly ctimeNanoseconds: number;
68
- readonly mtimeSeconds: number;
69
- readonly mtimeNanoseconds: number;
70
- readonly dev: number;
71
- readonly ino: number;
72
- readonly mode: FileMode;
73
- readonly uid: number;
74
- readonly gid: number;
75
- readonly fileSize: number;
76
- readonly id: ObjectId;
77
- readonly flags: IndexEntryFlags;
78
- readonly path: FilePath;
79
- }
80
- interface IndexExtension {
81
- readonly signature: string;
82
- readonly data: Uint8Array;
83
- }
84
- interface GitIndex {
85
- readonly version: 2;
86
- readonly entries: ReadonlyArray<IndexEntry>;
87
- readonly extensions: ReadonlyArray<IndexExtension>;
88
- }
89
-
90
- interface RenameDetectOptions {
91
- readonly limit?: number;
92
- readonly maxSameIdDeletes?: number;
93
- }
1
+ import { G as GitIndex, I as IndexEntry } from '../chunks/write-tree-DNjhjS3t.js';
2
+ export { C as CreateCommitInput, D as DiffTreesInput, a as DiffTreesOptions, M as MAX_COMMIT_MESSAGE_BYTES, b as MAX_GITIGNORE_BYTES, c as MAX_HAVES, d as MAX_INDEX_BYTES, e as MAX_PEEL_DEPTH, f as MAX_PUSH_OBJECTS, g as MAX_SYMBOLIC_REF_DEPTH, h as MAX_WALK_QUEUE_SIZE, i as MAX_WALK_SEEDS, j as MAX_WORKING_TREE_BLOB_BYTES, R as ReadObjectOptions, k as ResolveRefOptions, U as UpdateRefOptions, W as WalkCommitsOptions, l as WalkIgnorePredicate, m as WalkTreeEntry, n as WalkTreeOptions, o as WalkWorkingTreeEntry, p as WalkWorkingTreeOptions, q as createCommit, r as diffTrees, s as getRepoRoot, t as mergeBase, u as readBlob, v as readIndex, w as readObject, x as readTree, y as resolveRef, z as updateRef, A as walkCommits, B as walkTree, E as walkWorkingTree, F as writeObject, H as writeSymbolicRef, J as writeTree } from '../chunks/write-tree-DNjhjS3t.js';
3
+ import { d as FilePath, O as ObjectId, b as Context } from '../chunks/context-o5TPfMB2.js';
4
+ import { F as FileMode } from '../chunks/diff-change-alGRzD_j.js';
5
+ export { T as TreeDiff } from '../chunks/diff-change-alGRzD_j.js';
6
+ import { b as HttpTransport } from '../chunks/http-transport-DirKfK2S.js';
94
7
 
95
8
  /**
96
- * Phase 7 primitive option shapes, walker value types, and shared constants.
97
- * Defined in one location to avoid circular imports between primitive modules.
9
+ * Pure helper that diffs a current GitIndex against a target tree's flat
10
+ * entry list and emits an ordered ChangesetEntry list. No FS, no ctx; the
11
+ * impure write side lives in `apply-changeset.ts`.
12
+ *
13
+ * Stage-0 entries only — unmerged stages are invisible to checkout (Phase
14
+ * 13.1 design step 5).
98
15
  */
99
16
 
100
- /** Max symbolic-ref dereferences resolveRef will follow. */
101
- declare const MAX_SYMBOLIC_REF_DEPTH = 5;
102
- /** Max tag-peel hops resolveRef / readTree will follow when peeling. */
103
- declare const MAX_PEEL_DEPTH = 5;
104
- /** Max seeds walkCommits.from can contain. */
105
- declare const MAX_WALK_SEEDS = 1024;
106
- /** Hard cap on walkCommits' pending queue size to prevent unbounded heap growth. */
107
- declare const MAX_WALK_QUEUE_SIZE: number;
108
- /** Max .git/index file size readIndex will accept. */
109
- declare const MAX_INDEX_BYTES: number;
110
- /** Max commit message byte length createCommit will accept. */
111
- declare const MAX_COMMIT_MESSAGE_BYTES: number;
112
- interface ReadObjectOptions {
113
- readonly verifyHash?: boolean;
114
- }
115
- interface ResolveRefOptions {
116
- readonly peel?: boolean;
117
- readonly maxSymbolicDepth?: number;
118
- readonly maxPeelDepth?: number;
17
+ interface ChangesetEntry {
18
+ readonly kind: 'add' | 'update' | 'delete' | 'noop';
19
+ readonly path: FilePath;
20
+ readonly mode: FileMode;
21
+ readonly id: ObjectId | undefined;
22
+ readonly previousId: ObjectId | undefined;
23
+ readonly previousMode: FileMode | undefined;
119
24
  }
120
- interface UpdateRefOptions {
121
- readonly expected?: ObjectId | 'absent';
122
- readonly delete?: boolean;
25
+ interface ChangesetStats {
26
+ readonly add: number;
27
+ readonly update: number;
28
+ readonly delete: number;
29
+ readonly noop: number;
123
30
  }
124
- interface WalkCommitsOptions {
125
- readonly from: ReadonlyArray<ObjectId>;
126
- readonly until?: ReadonlyArray<ObjectId>;
127
- readonly order?: 'topo' | 'first-parent';
128
- readonly ignoreMissing?: boolean;
129
- readonly verifyHash?: boolean;
31
+ interface Changeset {
32
+ readonly entries: ReadonlyArray<ChangesetEntry>;
33
+ readonly stats: ChangesetStats;
130
34
  }
131
- interface WalkTreeEntry {
35
+ interface TargetEntry {
132
36
  readonly path: FilePath;
133
37
  readonly id: ObjectId;
134
38
  readonly mode: FileMode;
135
39
  }
136
- interface WalkTreeOptions {
137
- readonly recursive?: boolean;
138
- readonly maxDepth?: number;
139
- readonly maxEntries?: number;
140
- }
141
- interface CreateCommitInput {
142
- readonly tree: ObjectId;
143
- readonly parents: ReadonlyArray<ObjectId>;
144
- readonly author: AuthorIdentity;
145
- readonly committer: AuthorIdentity;
146
- readonly message: string;
147
- readonly gpgSignature?: string;
148
- readonly extraHeaders?: ReadonlyArray<ExtraHeader>;
40
+ declare const computeChangeset: (currentIndex: GitIndex, targetTree: ReadonlyArray<TargetEntry>) => Changeset;
41
+
42
+ interface ApplyChangesetOpts {
43
+ readonly changeset: Changeset;
44
+ readonly force: boolean;
45
+ readonly workdir: string;
149
46
  }
150
- type DiffTreesInput = Tree | ObjectId | undefined;
151
- interface DiffTreesOptions {
152
- readonly detectRenames?: boolean;
153
- readonly renameOptions?: RenameDetectOptions;
47
+ interface ApplyChangesetResult {
48
+ readonly writtenEntries: ReadonlyArray<IndexEntry>;
49
+ readonly written: number;
50
+ readonly deleted: number;
154
51
  }
52
+ declare const applyChangeset: (ctx: Context, opts: ApplyChangesetOpts) => Promise<ApplyChangesetResult>;
155
53
 
156
- declare function createCommit(ctx: Context, input: CreateCommitInput): Promise<ObjectId>;
54
+ /**
55
+ * Project a target tree onto a fresh stage-0 IndexEntry list, preserving
56
+ * stat-cache fields from the prior index where the path's `id` AND `mode`
57
+ * both match (the "stat-cache donor" strategy).
58
+ *
59
+ * Pure with respect to the working tree: this primitive never calls
60
+ * `fs.lstat`, `fs.read`, or any working-tree-side API. It only reads git
61
+ * objects via `walkTree` → `readObject` for nested trees.
62
+ *
63
+ * Used by `reset --mixed` to rebuild the index from a target
64
+ * commit's tree. Will be re-used by `reset --hard` composed
65
+ * with `materializeTree` to also write the working tree.
66
+ *
67
+ * ## Preconditions
68
+ *
69
+ * `currentIndex` MUST be read under the same `acquireIndexLock` that will
70
+ * later commit the result. Reading the index BEFORE the lock is acquired
71
+ * lets a concurrent writer mutate it between the donor-map build and the
72
+ * commit, producing a result that reflects neither the pre-reset nor the
73
+ * post-reset state. See `reset.ts:rebuildIndexFromCommit` for the
74
+ * canonical pattern: acquire → read → build → commit → release-in-finally.
75
+ */
157
76
 
158
- declare function diffTrees(ctx: Context, a: DiffTreesInput, b: DiffTreesInput, options?: DiffTreesOptions): Promise<TreeDiff>;
77
+ interface BuildIndexFromTreeOpts {
78
+ readonly targetTree: ObjectId;
79
+ readonly currentIndex: GitIndex;
80
+ }
81
+ declare const buildIndexFromTree: (ctx: Context, opts: BuildIndexFromTreeOpts) => Promise<ReadonlyArray<IndexEntry>>;
82
+
83
+ interface BuildPackInput {
84
+ readonly oids: ReadonlyArray<ObjectId>;
85
+ }
86
+ interface BuildPackResult {
87
+ readonly bytes: Uint8Array;
88
+ /** Hex SHA of the pack body, also the trailer (last 20 bytes). */
89
+ readonly sha: string;
90
+ readonly objectCount: number;
91
+ }
92
+ declare const buildPack: (ctx: Context, input: BuildPackInput) => Promise<BuildPackResult>;
93
+
94
+ interface EnumeratePushObjectsInput {
95
+ /**
96
+ * Object ids the caller wants on the remote. Each MUST resolve to a
97
+ * commit or an annotated tag (tags are unwrapped to commits before the
98
+ * commit walk).
99
+ */
100
+ readonly wants: ReadonlyArray<ObjectId>;
101
+ /** Object ids the remote already has (server's advertised ref tips). */
102
+ readonly haves: ReadonlyArray<ObjectId>;
103
+ /** Hard cap on objects emitted. Defaults to MAX_PUSH_OBJECTS. */
104
+ readonly maxObjects?: number;
105
+ }
106
+ declare function enumeratePushObjects(ctx: Context, input: EnumeratePushObjectsInput): AsyncIterable<ObjectId>;
107
+
108
+ interface FetchPackInput {
109
+ /** Advertised refs the caller wants. MUST be non-empty (server-side requirement). */
110
+ readonly wants: ReadonlyArray<ObjectId>;
111
+ /** Objects the caller already has (negotiation). Empty for clone, populated for fetch. */
112
+ readonly haves: ReadonlyArray<ObjectId>;
113
+ /** Negotiated capabilities (intersection of advertised + supported). */
114
+ readonly capabilities: ReadonlyArray<string>;
115
+ /** Base remote URL (the same URL passed to clone). */
116
+ readonly url: string;
117
+ /** Progress op label — clone uses 'clone:write-objects', fetch uses 'fetch:write-objects'. */
118
+ readonly progressOp: string;
119
+ /**
120
+ * Shallow clone depth. When set, sends `deepen N` and consumes the
121
+ * accompanying `shallow <oid>` / `unshallow <oid>` response block.
122
+ *
123
+ */
124
+ readonly depth?: number;
125
+ }
126
+ interface FetchPackResult {
127
+ readonly packPath: string;
128
+ readonly idxPath: string;
129
+ readonly objectCount: number;
130
+ /** Hex-encoded SHA of the pack trailer; also the on-disk filename stem. */
131
+ readonly packSha: string;
132
+ /** Commits the server advertised as new shallow boundaries (empty when depth is unset). */
133
+ readonly shallow: ReadonlyArray<ObjectId>;
134
+ /** Commits the server advertised as no-longer-shallow (empty when depth is unset). */
135
+ readonly unshallow: ReadonlyArray<ObjectId>;
136
+ }
137
+ declare const fetchPack: (ctx: Context, transport: HttpTransport, input: FetchPackInput) => Promise<FetchPackResult>;
159
138
 
160
139
  /**
161
- * Compute a merge base the first commit reachable from BOTH `a` and `b`.
140
+ * Compose `walkTree computeChangeset applyChangeset` to update the
141
+ * working tree to a target tree's contents.
142
+ *
143
+ * - Branch switch mode: `paths === undefined` — diff the entire current
144
+ * index against the entire target tree.
145
+ * - Path-restore mode: `paths !== undefined` — restrict both sides of
146
+ * the diff to those paths.
162
147
  *
163
- * Algorithm: bidirectional BFS with two visited sets. After each layer
164
- * advance, check the intersection. When non-empty, return the
165
- * lexicographically smallest oid (deterministic tie-breaker).
148
+ * Returns the new IndexEntry list for the caller to commit, plus
149
+ * written/deleted counts. The primitive does NOT commit the index — the
150
+ * caller decides.
166
151
  *
167
- * Returns `undefined` for unrelated histories. Documented limitation: cherry-picks
168
- * and criss-cross merges may yield non-optimal bases — `recursive`-strategy
169
- * multi-base resolution is v2.
152
+ * ## Stat-source contract for `newIndexEntries` (load-bearing for)
153
+ *
154
+ * - **Paths that were written/added** (`add` or `update` changeset entries):
155
+ * the IndexEntry carries **post-write `lstat`-derived stat fields**
156
+ * (ctime/mtime/dev/ino/uid/gid/fileSize). These reflect the file we just
157
+ * wrote, so the next `status` runs the fast `isStatClean` path.
158
+ * - **Paths whose changeset classification was `noop`** (skipped — index
159
+ * already matched target by `id + mode`): the IndexEntry is the caller's
160
+ * `currentIndex` entry verbatim. Donor stats survive across the call.
161
+ * - `reset --hard` therefore MUST set `forceRewriteAll: true` so every noop
162
+ * upgrades to update and the post-write stats land in the output. Without
163
+ * that, a locally-modified working-tree file that the index still records
164
+ * as clean would survive the reset, AND the donor stats would be stale
165
+ * relative to the actual disk state.
170
166
  */
171
- declare const mergeBase: (ctx: Context, a: ObjectId, b: ObjectId) => Promise<ObjectId | undefined>;
167
+
168
+ interface MaterializeTreeOpts {
169
+ readonly targetTree: ObjectId;
170
+ readonly currentIndex: GitIndex;
171
+ readonly force?: boolean;
172
+ readonly paths?: ReadonlySet<FilePath>;
173
+ /**
174
+ * When true, every target-tree path is written to the working tree
175
+ * unconditionally — even paths the index→target diff classified as `noop`
176
+ * (same `id` AND `mode`). Required by `reset --hard`, where the working
177
+ * tree may diverge from the index (uncommitted local modifications); the
178
+ * standard index→target diff cannot see that drift, so noops would skip
179
+ * paths the caller wants overwritten. Default `false` keeps the Phase
180
+ * 13.1 checkout behaviour: clean files are never spuriously rewritten.
181
+ */
182
+ readonly forceRewriteAll?: boolean;
183
+ }
184
+ interface MaterializeTreeResult {
185
+ readonly newIndexEntries: ReadonlyArray<IndexEntry>;
186
+ readonly written: number;
187
+ readonly deleted: number;
188
+ }
189
+ declare const materializeTree: (ctx: Context, opts: MaterializeTreeOpts) => Promise<MaterializeTreeResult>;
172
190
 
173
191
  /**
174
- * Pure path helpers composing `ctx.layout.gitDir` with known sub-paths.
175
- * No I/O. No port access. Primitive step 3.
192
+ * Read `.git/shallow`. Returns an empty set when the file does not exist or
193
+ * contains no oids. Malformed lines are tolerated (skipped) — canonical
194
+ * git behaves the same; a corrupted shallow file should not block a fetch.
176
195
  */
177
-
196
+ declare const readShallow: (ctx: Context) => Promise<ReadonlySet<ObjectId>>;
197
+ interface ShallowUpdate {
198
+ readonly shallow: ReadonlyArray<ObjectId>;
199
+ readonly unshallow: ReadonlyArray<ObjectId>;
200
+ }
178
201
  /**
179
- * Repository working-tree root. Returns the workDir from the current context;
180
- * facade-tier code (Phase 10) is responsible for discovery / realpath pinning
181
- * at construction time. Primitives consume the already-resolved path.
202
+ * Apply a set of shallow / unshallow updates to `.git/shallow`. Writes
203
+ * atomically via lock-rename; deletes the file when the resulting set is
204
+ * empty.
182
205
  */
183
- declare const getRepoRoot: (ctx: Context) => FilePath;
184
-
185
- declare function readBlob(ctx: Context, id: ObjectId, options?: ReadObjectOptions): Promise<Blob>;
186
-
187
- declare function readIndex(ctx: Context): Promise<GitIndex>;
188
-
189
- declare function readObject(ctx: Context, id: ObjectId, options?: ReadObjectOptions): Promise<GitObject>;
190
-
191
- declare function readTree(ctx: Context, ref: RefName | ObjectId): Promise<Tree>;
192
-
193
- declare function resolveRef(ctx: Context, name: RefName | 'HEAD', options?: ResolveRefOptions): Promise<ObjectId>;
194
-
195
- declare function updateRef(ctx: Context, name: RefName, newId: ObjectId, options?: UpdateRefOptions): Promise<void>;
196
-
197
- declare function walkCommits(ctx: Context, options: WalkCommitsOptions): AsyncIterable<Commit>;
198
-
199
- declare function walkTree(ctx: Context, treeIdOrObject: ObjectId | Tree, options?: WalkTreeOptions): AsyncIterable<WalkTreeEntry>;
200
-
201
- declare function writeObject(ctx: Context, object: GitObject): Promise<ObjectId>;
206
+ declare const updateShallow: (ctx: Context, updates: ShallowUpdate) => Promise<void>;
202
207
 
203
208
  /**
204
- * Write a symbolic ref atomically. Used for HEAD updates that point at a
205
- * branch, branch renames affecting the current HEAD, and `clone`/`init`
206
- * to set the initial HEAD.
209
+ * Synthesise a nested `Tree` object from a flat `GitIndex` and return the
210
+ * root tree's `ObjectId`. Sub-trees are written to the object store as a
211
+ * side-effect of the recursive descent — only stage-0 entries contribute.
212
+ *
213
+ * Used by `checkout({ paths, source: 'index' })` to restore
214
+ * the working tree from staged content even when the index has diverged
215
+ * from HEAD via `add` / `rm`. The previous placeholder fell back to
216
+ * HEAD's tree, which silently lost the divergence.
217
+ *
218
+ * The synthesis is the inverse of `buildIndexFromTree`:
219
+ * "tree → index" and "index → tree" form a round-trip identity for any
220
+ * stage-0-only index.
221
+ *
222
+ * Pure with respect to the working tree — never calls `fs.lstat`,
223
+ * `fs.read`, or any working-tree-side API. Only writes git objects via
224
+ * the existing `writeTree` primitive.
207
225
  *
208
- * Single-level only in v1: target MUST be a direct ref name (no chained
209
- * symrefs). Validation runs through `validateRefName` for both `name` and
210
- * `target` invalid inputs throw INVALID_REF before any I/O.
226
+ * ## Safety
227
+ *
228
+ * - **Path validation**:.7 hoisted segment-level validation into
229
+ * `parseIndex` (`src/domain/git-index/path-validator.ts`). Every
230
+ * `IndexEntry` reaching this primitive THROUGH THE CANONICAL PARSER
231
+ * carries a `FilePath` value already free of `..`, `.`, empty segments,
232
+ * and leading-slash absolute paths. However, the primitive is also
233
+ * reachable from callers that construct `IndexEntry` records outside
234
+ * the parser (test fixtures, in-memory adapters, future synthesisers).
235
+ * Defence-in-depth: every entry is re-validated here so the primitive
236
+ * stays safe even when the parser-trusted path is bypassed.
237
+ * - **Depth cap**: synthesis bounds recursion at `MAX_TREE_DEPTH` (4096,
238
+ * matching git's canonical limit). The cap is enforced at the input
239
+ * boundary by counting slashes — by the time recursion would catch a
240
+ * pathological depth, the JS engine has already exhausted its call
241
+ * stack. Path validation does NOT subsume this check: a path can be
242
+ * safe segment-by-segment (no `..`/`.`/empty) and still be 10 000
243
+ * levels deep.
211
244
  */
212
- declare const writeSymbolicRef: (ctx: Context, name: RefName, target: RefName) => Promise<void>;
213
245
 
214
- declare function writeTree(ctx: Context, entries: ReadonlyArray<TreeEntry>): Promise<ObjectId>;
246
+ /**
247
+ * Public entry: pass the `entries` array directly (typically
248
+ * `index.entries`, but callers holding a filtered list may supply it
249
+ * without wrapping in a fake `GitIndex`).
250
+ */
251
+ declare const synthesizeTreeFromIndex: (ctx: Context, entries: ReadonlyArray<IndexEntry>) => Promise<ObjectId>;
215
252
 
216
- export { MAX_COMMIT_MESSAGE_BYTES, MAX_INDEX_BYTES, MAX_PEEL_DEPTH, MAX_SYMBOLIC_REF_DEPTH, MAX_WALK_QUEUE_SIZE, MAX_WALK_SEEDS, TreeDiff, createCommit, diffTrees, getRepoRoot, mergeBase, readBlob, readIndex, readObject, readTree, resolveRef, updateRef, walkCommits, walkTree, writeObject, writeSymbolicRef, writeTree };
217
- export type { CreateCommitInput, DiffTreesInput, DiffTreesOptions, ReadObjectOptions, ResolveRefOptions, UpdateRefOptions, WalkCommitsOptions, WalkTreeEntry, WalkTreeOptions };
253
+ export { applyChangeset, buildIndexFromTree, buildPack, computeChangeset, enumeratePushObjects, fetchPack, materializeTree, readShallow, synthesizeTreeFromIndex, updateShallow };
254
+ export type { ApplyChangesetOpts, ApplyChangesetResult, BuildIndexFromTreeOpts, BuildPackInput, BuildPackResult, Changeset, ChangesetEntry, ChangesetStats, EnumeratePushObjectsInput, FetchPackInput, FetchPackResult, MaterializeTreeOpts, MaterializeTreeResult };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scolladon/tsgit",
3
- "version": "1.0.0",
3
+ "version": "1.1.0",
4
4
  "description": "Lightning-fast git, pure TypeScript, everywhere.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -176,12 +176,16 @@
176
176
  "test": "wireit",
177
177
  "test:unit": "wireit",
178
178
  "test:integration": "wireit",
179
+ "test:posix-integration": "wireit",
180
+ "test:win-integration": "wireit",
179
181
  "test:e2e": "wireit",
180
182
  "test:coverage": "wireit",
181
183
  "test:mutation": "wireit",
182
184
  "test:mutation:incremental": "wireit",
183
185
  "test:bench": "wireit",
184
186
  "bench:summary": "wireit",
187
+ "bench:fixture": "node --experimental-strip-types scripts/gen-bench-fixture.ts",
188
+ "profile": "npm run build && node --experimental-strip-types scripts/profile.ts",
185
189
  "docs": "wireit",
186
190
  "docs:check": "wireit",
187
191
  "verify:tarball": "wireit",
@@ -313,6 +317,30 @@
313
317
  ],
314
318
  "output": []
315
319
  },
320
+ "test:posix-integration": {
321
+ "command": "vitest run --project posix-integration",
322
+ "dependencies": [
323
+ "check:types"
324
+ ],
325
+ "files": [
326
+ "src/**/*.ts",
327
+ "test/integration/posix-only/**/*.ts",
328
+ "vitest.config.ts"
329
+ ],
330
+ "output": []
331
+ },
332
+ "test:win-integration": {
333
+ "command": "vitest run --project win-integration",
334
+ "dependencies": [
335
+ "check:types"
336
+ ],
337
+ "files": [
338
+ "src/**/*.ts",
339
+ "test/integration/win-only/**/*.ts",
340
+ "vitest.config.ts"
341
+ ],
342
+ "output": []
343
+ },
316
344
  "test:e2e": {
317
345
  "command": "npx playwright test",
318
346
  "dependencies": [
@@ -329,7 +357,7 @@
329
357
  ]
330
358
  },
331
359
  "test:coverage": {
332
- "command": "vitest run --coverage",
360
+ "command": "vitest run --project unit --coverage",
333
361
  "dependencies": [
334
362
  "check:types"
335
363
  ],
@@ -503,8 +531,8 @@
503
531
  },
504
532
  "lint-staged": {
505
533
  "*.ts": [
506
- "biome check --write",
507
- "vitest related --run"
534
+ "biome check --write --no-errors-on-unmatched",
535
+ "vitest related --run --project unit"
508
536
  ]
509
537
  },
510
538
  "devDependencies": {
@@ -521,14 +549,14 @@
521
549
  "@stryker-mutator/core": "9.6.1",
522
550
  "@stryker-mutator/typescript-checker": "9.6.1",
523
551
  "@stryker-mutator/vitest-runner": "9.6.1",
524
- "@types/node": "25.8.0",
525
- "@vitest/coverage-v8": "4.1.6",
552
+ "@types/node": "25.9.1",
553
+ "@vitest/coverage-v8": "4.1.7",
526
554
  "cspell": "10.0.0",
527
555
  "dependency-cruiser": "17.4.0",
528
556
  "fast-check": "4.8.0",
529
557
  "husky": "9.1.7",
530
- "isomorphic-git": "1.38.0",
531
- "jscpd": "4.2.2",
558
+ "isomorphic-git": "1.38.1",
559
+ "jscpd": "4.2.3",
532
560
  "knip": "6.14.1",
533
561
  "lint-staged": "17.0.5",
534
562
  "rollup": "4.60.4",
@@ -537,7 +565,7 @@
537
565
  "size-limit": "12.1.0",
538
566
  "typedoc": "0.28.19",
539
567
  "typescript": "6.0.3",
540
- "vitest": "4.1.6",
568
+ "vitest": "4.1.7",
541
569
  "wireit": "0.14.12"
542
570
  }
543
571
  }
@@ -1,2 +0,0 @@
1
- "use strict";class e extends Error{data;name="TsgitError";constructor(e){super(`${e.code}: ${function(e){switch(e.code){case"INVALID_OBJECT_ID":case"INVALID_FILE_MODE":return e.value;case"INVALID_OBJECT_HEADER":case"INVALID_TREE_ENTRY":case"INVALID_COMMIT":case"INVALID_TAG":case"INVALID_IDENTITY":case"INVALID_PACK_HEADER":case"INVALID_PACK_INDEX":case"INVALID_PACK_ENTRY":case"INVALID_DELTA":case"INVALID_REF":case"INVALID_PACKED_REFS":case"INVALID_INDEX_HEADER":case"INVALID_INDEX_ENTRY":return e.reason;case"FILE_NOT_FOUND":return`file not found: ${r(e.path)}`;case"FILE_EXISTS":return`file already exists: ${r(e.path)}`;case"NOT_A_DIRECTORY":return`not a directory: ${r(e.path)}`;case"PERMISSION_DENIED":return`permission denied: ${r(e.path)}`;case"UNSUPPORTED_OPERATION":return`unsupported operation: ${e.operation}: ${e.reason}`;case"HASH_FAILED":return`hash computation failed: ${e.reason}`;case"COMPRESS_FAILED":return`compression failed: ${e.reason}`;case"DECOMPRESS_FAILED":return`decompression failed: ${e.reason}`;case"HTTP_ERROR":return`HTTP ${e.statusCode}: ${e.reason}`;case"NETWORK_ERROR":return`network error: ${e.reason}`;case"INVALID_TREE_FOR_DIFF":return`invalid tree for diff: ${e.reason}`;case"INVALID_DIFF_INPUT":return`invalid diff input: ${e.reason}`;case"INVALID_MERGE_TREE":return`invalid merge tree: ${e.reason}`;case"INVALID_MERGE_INPUT":return`invalid merge input: ${e.reason}`;case"OBJECT_NOT_FOUND":return`object not found: ${e.id}`;case"OBJECT_HASH_MISMATCH":return`object hash mismatch: expected=${e.expected} actual=${e.actual}`;case"UNEXPECTED_OBJECT_TYPE":return`unexpected object type: expected=${e.expected} actual=${e.actual} id=${e.id}`;case"TREE_CYCLE_DETECTED":return`tree cycle detected: ${e.id}`;case"TREE_DEPTH_EXCEEDED":return`tree depth exceeded: ${e.depth}`;case"TREE_ENTRY_LIMIT_EXCEEDED":return`tree entry limit exceeded: count=${e.count} limit=${e.limit}`;case"DELTA_CHAIN_TOO_DEEP":return`delta chain too deep: ${e.depth}`;case"REF_NOT_FOUND":return`ref not found: ${e.name}`;case"REF_CHAIN_TOO_DEEP":return`ref chain too deep: depth=${e.depth} chain=${e.chain.join("->")}`;case"REF_CYCLE_DETECTED":return`ref cycle detected: ${e.chain.join("->")}`;case"REF_LOCKED":return`ref locked: ${e.name}`;case"REF_UPDATE_CONFLICT":return`ref update conflict: name=${e.name} expected=${e.expected} actual=${e.actual}`;case"INVALID_WALK_INPUT":return`invalid walk input: ${e.reason}`;case"OPERATION_ABORTED":return"operation aborted";case"INVALID_PKT_LENGTH":return`invalid pkt-line length: ${e.value}`;case"PKT_LENGTH_RESERVED":return`reserved pkt-line length: ${e.value}`;case"PKT_TOO_LARGE":return`pkt-line too large: ${e.value} bytes (max 65520)`;case"PKT_TRUNCATED":return`pkt-line truncated: ${e.remaining} bytes remaining`;case"INVALID_BASE_URL":return`invalid base URL: ${e.reason}`;case"MISSING_SERVICE_HEADER":return`missing service header: expected=${e.expected} actual=${e.actual}`;case"MISSING_CAPABILITIES":return"missing capabilities in advertisement";case"INVALID_REF_LINE":return`invalid ref line: ${e.line}`;case"DUPLICATE_REF":return`duplicate ref: ${e.name}`;case"INVALID_SIDEBAND_CHANNEL":return`invalid sideband channel: ${e.channel}`;case"SIDEBAND_FATAL":return`sideband fatal: ${e.message}`;case"UNKNOWN_ACK_STATUS":return`unknown ack status: ${e.value}`;case"INVALID_REPORT_STATUS":return`invalid report-status line: ${e.line}`;case"EMPTY_WANTS":return"upload-pack request has no wants";case"EMPTY_RECEIVE_UPDATES":return"receive-pack request has no updates";case"RESOURCE_LOCKED":return`${e.resource} locked: ${r(e.path)}`;case"PACK_TOO_LARGE":return`pack contains ${e.objectCount} objects, exceeds limit ${e.limit}`;case"NOT_A_REPOSITORY":return`not a git repository: ${r(e.path)}`;case"BARE_REPOSITORY":return`operation requires a working tree: ${e.operation}`;case"ALREADY_INITIALIZED":return`repository already exists: ${r(e.path)}`;case"WORKING_TREE_DIRTY":return`working tree has uncommitted changes: ${e.paths.length} files`;case"PATHSPEC_NO_MATCH":return`pathspec did not match any files: ${e.pattern}`;case"PATHSPEC_OUTSIDE_REPO":return`pathspec resolves outside repository: ${r(e.path)}`;case"NOTHING_TO_COMMIT":return"nothing to commit (use allowEmpty: true to commit anyway)";case"EMPTY_COMMIT_MESSAGE":return"commit message is empty (use allowEmptyMessage: true to commit anyway)";case"AUTHOR_UNCONFIGURED":return"author identity not configured (set ctx.config.user or pass author/committer)";case"BRANCH_EXISTS":return`branch already exists: ${e.name}`;case"BRANCH_NOT_FOUND":return`branch not found: ${e.name}`;case"TAG_EXISTS":return`tag already exists: ${e.name}`;case"TAG_NOT_FOUND":return`tag not found: ${e.name}`;case"CANNOT_DELETE_CHECKED_OUT_BRANCH":return`cannot delete branch currently checked out: ${e.name}`;case"INVALID_URL":return`invalid URL: ${e.reason}`;case"BLOCKED_HOST":return`host blocked: ${e.host} (${e.reason})`;case"TOO_MANY_REDIRECTS":return`too many redirects: ${e.count}`;case"UNSUPPORTED_SCHEME":return`unsupported URL scheme: ${e.scheme}`;case"TARGET_DIRECTORY_NOT_EMPTY":return`target directory is not empty: ${r(e.path)}`;case"REMOTE_ADVERTISES_NO_REFS":return"remote advertised no refs";case"NON_FAST_FORWARD":return`non-fast-forward update for ${e.ref}: local=${e.local} remote=${e.remote}`;case"PUSH_REJECTED":return`push rejected for ${e.ref}: ${e.reason}`;case"MERGE_HAS_CONFLICTS":return`merge has unresolved conflicts: ${e.count} files`;case"CHECKOUT_OVERWRITE_DIRTY":return`checkout would overwrite uncommitted changes: ${e.paths.length} files`;case"REVPARSE_AMBIGUOUS":return`revision expression "${e.expression}" is ambiguous (${e.candidates.length} candidates)`;case"REVPARSE_UNRESOLVED":return`cannot resolve revision: ${e.expression}`;case"EMPTY_PATHSPEC":return'pathspec is empty (use "." to mean "all paths")';case"OPERATION_IN_PROGRESS":return`${e.operation} in progress; complete or abort it before running this command`;case"MAX_REFSPECS_EXCEEDED":return`${e.count} refspecs exceeds limit ${e.limit}`;case"REMOTE_NOT_CONFIGURED":return`remote not configured: ${e.remote}`;case"REFSPEC_INVALID":return`invalid refspec "${e.raw}": ${e.reason}`;case"INVALID_OPTION":return`invalid option: ${e.option} — ${e.reason}`;case"REPOSITORY_DISPOSED":return"repository has been disposed; create a new one with openRepository()";case"ADAPTER_UNAVAILABLE":return`adapter unavailable for runtime ${e.runtime}: ${e.reason}`;default:return String(e)}}(e)}`),this.data=e}}function r(e){const r=e.split(/[/\\]/);for(let e=r.length-1;e>=0;e--){const t=r[e];if(void 0!==t&&""!==t)return t}return e}exports.TsgitError=e,exports.compressFailed=r=>new e({code:"COMPRESS_FAILED",reason:r}),exports.decompressFailed=r=>new e({code:"DECOMPRESS_FAILED",reason:r}),exports.fileExists=r=>new e({code:"FILE_EXISTS",path:r}),exports.fileNotFound=r=>new e({code:"FILE_NOT_FOUND",path:r}),exports.hashFailed=r=>new e({code:"HASH_FAILED",reason:r}),exports.invalidWalkInput=r=>new e({code:"INVALID_WALK_INPUT",reason:r}),exports.networkError=r=>new e({code:"NETWORK_ERROR",reason:r}),exports.notADirectory=r=>new e({code:"NOT_A_DIRECTORY",path:r}),exports.operationAborted=()=>new e({code:"OPERATION_ABORTED"}),exports.permissionDenied=r=>new e({code:"PERMISSION_DENIED",path:r}),exports.unsupportedOperation=(r,t)=>new e({code:"UNSUPPORTED_OPERATION",operation:r,reason:t});
2
- //# sourceMappingURL=error-DL4SHCBJ.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"error-DL4SHCBJ.cjs","sources":["../../../src/domain/error.ts"],"sourcesContent":[null],"names":["TsgitError","Error","data","name","constructor","super","code","value","reason","basename","path","operation","statusCode","id","expected","actual","depth","count","limit","chain","join","remaining","line","channel","message","resource","objectCount","paths","length","pattern","host","scheme","ref","local","remote","expression","candidates","raw","option","runtime","String","extractDetail","this","segments","split","i","segment","undefined"],"mappings":"aAuDM,MAAOA,UAAmBC,MAGTC,KAFHC,KAAO,aAEzB,WAAAC,CAAqBF,GACnBG,MAAM,GAAGH,EAAKI,SAsDlB,SAAuBJ,GACrB,OAAQA,EAAKI,MACX,IAAK,oBACL,IAAK,oBACH,OAAOJ,EAAKK,MACd,IAAK,wBACL,IAAK,qBACL,IAAK,iBACL,IAAK,cACL,IAAK,mBACL,IAAK,sBACL,IAAK,qBACL,IAAK,qBACL,IAAK,gBACL,IAAK,cACL,IAAK,sBACL,IAAK,uBACL,IAAK,sBACH,OAAOL,EAAKM,OACd,IAAK,iBACH,MAAO,mBAAmBC,EAASP,EAAKQ,QAC1C,IAAK,cACH,MAAO,wBAAwBD,EAASP,EAAKQ,QAC/C,IAAK,kBACH,MAAO,oBAAoBD,EAASP,EAAKQ,QAC3C,IAAK,oBACH,MAAO,sBAAsBD,EAASP,EAAKQ,QAC7C,IAAK,wBACH,MAAO,0BAA0BR,EAAKS,cAAcT,EAAKM,SAC3D,IAAK,cACH,MAAO,4BAA4BN,EAAKM,SAC1C,IAAK,kBACH,MAAO,uBAAuBN,EAAKM,SACrC,IAAK,oBACH,MAAO,yBAAyBN,EAAKM,SACvC,IAAK,aACH,MAAO,QAAQN,EAAKU,eAAeV,EAAKM,SAC1C,IAAK,gBACH,MAAO,kBAAkBN,EAAKM,SAChC,IAAK,wBACH,MAAO,0BAA0BN,EAAKM,SACxC,IAAK,qBACH,MAAO,uBAAuBN,EAAKM,SACrC,IAAK,qBACH,MAAO,uBAAuBN,EAAKM,SACrC,IAAK,sBACH,M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0BZ,IAAkB,IAAIV,EAAW,CAAEM,KAAM,+CAxBxCI,GAC/B,IAAIV,EAAW,CAAEM,KAAM,oBAAqBI,sCAEV,CAACC,EAAmBH,IACtD,IAAIR,EAAW,CAAEM,KAAM,wBAAyBK,YAAWH"}
@@ -1,2 +0,0 @@
1
- "use strict";var r=require("./error-DL4SHCBJ.cjs");const e=r=>{let e="";for(let o=0;o<r.length;o+=1){const t=r.charCodeAt(o);e+=9===t||10===t||t>=32&&t<=126?r[o]:`\\x${t.toString(16).toUpperCase().padStart(2,"0")}`}return e},o=e;exports.adapterUnavailable=(o,t)=>new r.TsgitError({code:"ADAPTER_UNAVAILABLE",runtime:o,reason:e(t)}),exports.authorUnconfigured=()=>new r.TsgitError({code:"AUTHOR_UNCONFIGURED"}),exports.blockedHost=(o,t)=>new r.TsgitError({code:"BLOCKED_HOST",host:e(o),reason:e(t)}),exports.branchExists=e=>new r.TsgitError({code:"BRANCH_EXISTS",name:e}),exports.branchNotFound=e=>new r.TsgitError({code:"BRANCH_NOT_FOUND",name:e}),exports.cannotDeleteCheckedOutBranch=e=>new r.TsgitError({code:"CANNOT_DELETE_CHECKED_OUT_BRANCH",name:e}),exports.checkoutOverwriteDirty=e=>new r.TsgitError({code:"CHECKOUT_OVERWRITE_DIRTY",paths:e}),exports.emptyCommitMessage=()=>new r.TsgitError({code:"EMPTY_COMMIT_MESSAGE"}),exports.emptyPathspec=()=>new r.TsgitError({code:"EMPTY_PATHSPEC"}),exports.invalidOption=(o,t)=>new r.TsgitError({code:"INVALID_OPTION",option:o,reason:e(t)}),exports.invalidUrl=e=>new r.TsgitError({code:"INVALID_URL",reason:e}),exports.nonFastForward=(e,o,t)=>new r.TsgitError({code:"NON_FAST_FORWARD",ref:e,local:o,remote:t}),exports.nothingToCommit=()=>new r.TsgitError({code:"NOTHING_TO_COMMIT"}),exports.operationInProgress=e=>new r.TsgitError({code:"OPERATION_IN_PROGRESS",operation:e}),exports.pathspecNoMatch=e=>new r.TsgitError({code:"PATHSPEC_NO_MATCH",pattern:e}),exports.pathspecOutsideRepo=e=>new r.TsgitError({code:"PATHSPEC_OUTSIDE_REPO",path:e}),exports.remoteAdvertisesNoRefs=()=>new r.TsgitError({code:"REMOTE_ADVERTISES_NO_REFS"}),exports.remoteNotConfigured=e=>new r.TsgitError({code:"REMOTE_NOT_CONFIGURED",remote:e}),exports.repositoryDisposed=()=>new r.TsgitError({code:"REPOSITORY_DISPOSED"}),exports.revparseUnresolved=e=>new r.TsgitError({code:"REVPARSE_UNRESOLVED",expression:e}),exports.sanitize=o,exports.tagExists=e=>new r.TsgitError({code:"TAG_EXISTS",name:e}),exports.tagNotFound=e=>new r.TsgitError({code:"TAG_NOT_FOUND",name:e}),exports.targetDirectoryNotEmpty=e=>new r.TsgitError({code:"TARGET_DIRECTORY_NOT_EMPTY",path:e}),exports.unsupportedScheme=e=>new r.TsgitError({code:"UNSUPPORTED_SCHEME",scheme:e});
2
- //# sourceMappingURL=error-DN8Vnwr4.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"error-DN8Vnwr4.cjs","sources":["../../../src/domain/commands/error.ts"],"sourcesContent":[null],"names":["sanitizeForDisplay","s","out","i","length","code","charCodeAt","toString","toUpperCase","padStart","sanitize","runtime","reason","TsgitError","host","name","paths","option","ref","local","remote","operation","pattern","path","expression","scheme"],"mappings":"mDAyDA,MAAMA,EAAsBC,IAC1B,IAAIC,EAAM,GACV,IAAK,IAAIC,EAAI,EAAGA,EAAIF,EAAEG,OAAQD,GAAK,EAAG,CACpC,MAAME,EAAOJ,EAAEK,WAAWH,GAExBD,GADW,IAATG,GAA0B,KAATA,GAAkBA,GAAQ,IAAQA,GAAQ,IACtDJ,EAAEE,GAEF,MAAME,EAAKE,SAAS,IAAIC,cAAcC,SAAS,EAAG,MAE7D,CACA,OAAOP,GAGIQ,EAAWV,6BA+FU,CAChCW,EACAC,IAEA,IAAIC,EAAAA,WAAW,CACbR,KAAM,sBACNM,UACAC,OAAQZ,EAAmBY,g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