@scolladon/tsgit 2.0.1 → 3.0.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 (152) hide show
  1. package/README.md +2 -2
  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/adapter-detect-D7DFJtuk.cjs +2 -0
  9. package/dist/cjs/chunks/adapter-detect-D7DFJtuk.cjs.map +1 -0
  10. package/dist/cjs/chunks/adler32-CrRRuL2P.cjs +2 -0
  11. package/dist/cjs/chunks/adler32-CrRRuL2P.cjs.map +1 -0
  12. package/dist/cjs/chunks/browser-http-transport-nGm6alox.cjs +2 -0
  13. package/dist/cjs/chunks/browser-http-transport-nGm6alox.cjs.map +1 -0
  14. package/dist/cjs/chunks/context-BcoAzPuU.cjs.map +1 -1
  15. package/dist/cjs/chunks/error-CA80UqXF.cjs +2 -0
  16. package/dist/cjs/chunks/error-CA80UqXF.cjs.map +1 -0
  17. package/dist/cjs/chunks/index-01WCH0eg.cjs +2 -0
  18. package/dist/cjs/chunks/index-01WCH0eg.cjs.map +1 -0
  19. package/dist/cjs/chunks/memory-http-transport-7hpDW8o3.cjs +2 -0
  20. package/dist/cjs/chunks/memory-http-transport-7hpDW8o3.cjs.map +1 -0
  21. package/dist/cjs/chunks/node-http-transport-CoqnAvIL.cjs +2 -0
  22. package/dist/cjs/chunks/node-http-transport-CoqnAvIL.cjs.map +1 -0
  23. package/dist/cjs/chunks/{progress-CxU62NC1.cjs → progress-CjhUeyxd.cjs} +2 -2
  24. package/dist/cjs/chunks/{progress-CxU62NC1.cjs.map → progress-CjhUeyxd.cjs.map} +1 -1
  25. package/dist/cjs/chunks/repository-DJNNrfQr.cjs +2 -0
  26. package/dist/cjs/chunks/repository-DJNNrfQr.cjs.map +1 -0
  27. package/dist/cjs/chunks/write-sparse-checkout-DzVubBcI.cjs +2 -0
  28. package/dist/cjs/chunks/write-sparse-checkout-DzVubBcI.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.cjs.map +1 -1
  34. package/dist/cjs/index.default.cjs +1 -1
  35. package/dist/cjs/index.default.cjs.map +1 -1
  36. package/dist/cjs/index.node.cjs +1 -1
  37. package/dist/cjs/index.node.cjs.map +1 -1
  38. package/dist/cjs/primitives/index.cjs +1 -1
  39. package/dist/cjs/primitives/index.cjs.map +1 -1
  40. package/dist/esm/adapters/browser/index.js +1 -1
  41. package/dist/esm/adapters/browser/index.js.map +1 -1
  42. package/dist/esm/adapters/memory/index.js +1 -1
  43. package/dist/esm/adapters/memory/index.js.map +1 -1
  44. package/dist/esm/adapters/node/index.js +1 -1
  45. package/dist/esm/adapters/node/index.js.map +1 -1
  46. package/dist/esm/chunks/adapter-detect-CTTG6hpk.js +2 -0
  47. package/dist/esm/chunks/adapter-detect-CTTG6hpk.js.map +1 -0
  48. package/dist/esm/chunks/adler32-BfvKJOAO.js +2 -0
  49. package/dist/esm/chunks/adler32-BfvKJOAO.js.map +1 -0
  50. package/dist/esm/chunks/browser-http-transport-DD0YKmIW.js +2 -0
  51. package/dist/esm/chunks/browser-http-transport-DD0YKmIW.js.map +1 -0
  52. package/dist/esm/chunks/context-CumKOV7K.js.map +1 -1
  53. package/dist/esm/chunks/error-BD0nFV6t.js +2 -0
  54. package/dist/esm/chunks/error-BD0nFV6t.js.map +1 -0
  55. package/dist/esm/chunks/index-BEI7XKaV.js +2 -0
  56. package/dist/esm/chunks/index-BEI7XKaV.js.map +1 -0
  57. package/dist/esm/chunks/memory-http-transport-D13LBPvu.js +2 -0
  58. package/dist/esm/chunks/memory-http-transport-D13LBPvu.js.map +1 -0
  59. package/dist/esm/chunks/node-http-transport-doU9Y8WN.js +2 -0
  60. package/dist/esm/chunks/node-http-transport-doU9Y8WN.js.map +1 -0
  61. package/dist/esm/chunks/{progress-BZobfl7p.js → progress-CLPpgZJ6.js} +2 -2
  62. package/dist/esm/chunks/{progress-BZobfl7p.js.map → progress-CLPpgZJ6.js.map} +1 -1
  63. package/dist/esm/chunks/repository-dCH3DdLQ.js +2 -0
  64. package/dist/esm/chunks/repository-dCH3DdLQ.js.map +1 -0
  65. package/dist/esm/chunks/write-sparse-checkout-D4tNUXOp.js +2 -0
  66. package/dist/esm/chunks/write-sparse-checkout-D4tNUXOp.js.map +1 -0
  67. package/dist/esm/commands/index.js +1 -1
  68. package/dist/esm/index.browser.js +1 -1
  69. package/dist/esm/index.browser.js.map +1 -1
  70. package/dist/esm/index.default.js +1 -1
  71. package/dist/esm/index.default.js.map +1 -1
  72. package/dist/esm/index.js +1 -1
  73. package/dist/esm/index.js.map +1 -1
  74. package/dist/esm/index.node.js +1 -1
  75. package/dist/esm/index.node.js.map +1 -1
  76. package/dist/esm/primitives/index.js +1 -1
  77. package/dist/esm/primitives/index.js.map +1 -1
  78. package/dist/types/adapters/browser/index.d.cts +5 -3
  79. package/dist/types/adapters/browser/index.d.ts +5 -3
  80. package/dist/types/adapters/memory/index.d.cts +31 -4
  81. package/dist/types/adapters/memory/index.d.ts +31 -4
  82. package/dist/types/adapters/node/index.d.cts +53 -5
  83. package/dist/types/adapters/node/index.d.ts +53 -5
  84. package/dist/types/chunks/{context-CCL0_F8R.d.ts → context-CNtbFlwI.d.ts} +119 -6
  85. package/dist/types/chunks/{context-YDw6qicq.d.cts → context-D_A7-uau.d.cts} +119 -6
  86. package/dist/types/chunks/{http-transport--_NdQOiw.d.cts → http-transport-DirKfK2S.d.cts} +1 -1
  87. package/dist/types/chunks/{http-transport--_NdQOiw.d.ts → http-transport-DirKfK2S.d.ts} +1 -1
  88. package/dist/types/chunks/index-BJDekgCP.d.ts +1122 -0
  89. package/dist/types/chunks/index-CMLLVz9B.d.cts +1122 -0
  90. package/dist/types/chunks/index-E_KapqW9.d.ts +2439 -0
  91. package/dist/types/chunks/index-wwZiot4c.d.cts +2439 -0
  92. package/dist/types/chunks/progress-Cp-huK45.d.cts +1171 -0
  93. package/dist/types/chunks/progress-hcn9r2H3.d.ts +1171 -0
  94. package/dist/types/chunks/reflog-entry-BGJr9VfU.d.cts +688 -0
  95. package/dist/types/chunks/reflog-entry-DecZqJna.d.ts +688 -0
  96. package/dist/types/chunks/{repository-BeifCqp0.d.cts → repository-DASBgOb9.d.cts} +58 -20
  97. package/dist/types/chunks/{repository-FoS_Laoy.d.ts → repository-Dxhwpzd6.d.ts} +58 -20
  98. package/dist/types/commands/index.d.cts +4 -1259
  99. package/dist/types/commands/index.d.ts +4 -1259
  100. package/dist/types/index.browser.d.cts +7 -8
  101. package/dist/types/index.browser.d.ts +7 -8
  102. package/dist/types/index.d.cts +61 -124
  103. package/dist/types/index.d.ts +61 -124
  104. package/dist/types/index.default.d.cts +7 -8
  105. package/dist/types/index.default.d.ts +7 -8
  106. package/dist/types/index.node.d.cts +7 -8
  107. package/dist/types/index.node.d.ts +7 -8
  108. package/dist/types/primitives/index.d.cts +4 -692
  109. package/dist/types/primitives/index.d.ts +4 -692
  110. package/dist/types/transport/index.d.cts +1 -1
  111. package/dist/types/transport/index.d.ts +1 -1
  112. package/package.json +21 -21
  113. package/dist/cjs/chunks/adapter-detect-CD_LcgaH.cjs +0 -2
  114. package/dist/cjs/chunks/adapter-detect-CD_LcgaH.cjs.map +0 -1
  115. package/dist/cjs/chunks/browser-http-transport-CiMRqtDS.cjs +0 -2
  116. package/dist/cjs/chunks/browser-http-transport-CiMRqtDS.cjs.map +0 -1
  117. package/dist/cjs/chunks/error-CfjFO3x_.cjs +0 -2
  118. package/dist/cjs/chunks/error-CfjFO3x_.cjs.map +0 -1
  119. package/dist/cjs/chunks/index-BWCq_5BJ.cjs +0 -2
  120. package/dist/cjs/chunks/index-BWCq_5BJ.cjs.map +0 -1
  121. package/dist/cjs/chunks/memory-http-transport-BVL6VgB-.cjs +0 -2
  122. package/dist/cjs/chunks/memory-http-transport-BVL6VgB-.cjs.map +0 -1
  123. package/dist/cjs/chunks/node-http-transport-BvfVcf02.cjs +0 -2
  124. package/dist/cjs/chunks/node-http-transport-BvfVcf02.cjs.map +0 -1
  125. package/dist/cjs/chunks/repository-BEg2zNtx.cjs +0 -2
  126. package/dist/cjs/chunks/repository-BEg2zNtx.cjs.map +0 -1
  127. package/dist/cjs/chunks/walk-submodules-D2Sp7JEB.cjs +0 -2
  128. package/dist/cjs/chunks/walk-submodules-D2Sp7JEB.cjs.map +0 -1
  129. package/dist/esm/chunks/adapter-detect-DkZhhUhd.js +0 -2
  130. package/dist/esm/chunks/adapter-detect-DkZhhUhd.js.map +0 -1
  131. package/dist/esm/chunks/browser-http-transport-4rJkHcQu.js +0 -2
  132. package/dist/esm/chunks/browser-http-transport-4rJkHcQu.js.map +0 -1
  133. package/dist/esm/chunks/error-Dc-SRSJK.js +0 -2
  134. package/dist/esm/chunks/error-Dc-SRSJK.js.map +0 -1
  135. package/dist/esm/chunks/index-jH0UMhh-.js +0 -2
  136. package/dist/esm/chunks/index-jH0UMhh-.js.map +0 -1
  137. package/dist/esm/chunks/memory-http-transport-CA1WxWBp.js +0 -2
  138. package/dist/esm/chunks/memory-http-transport-CA1WxWBp.js.map +0 -1
  139. package/dist/esm/chunks/node-http-transport-DPa2lK3T.js +0 -2
  140. package/dist/esm/chunks/node-http-transport-DPa2lK3T.js.map +0 -1
  141. package/dist/esm/chunks/repository-DF6ePd1x.js +0 -2
  142. package/dist/esm/chunks/repository-DF6ePd1x.js.map +0 -1
  143. package/dist/esm/chunks/walk-submodules-Dq9oGwP8.js +0 -2
  144. package/dist/esm/chunks/walk-submodules-Dq9oGwP8.js.map +0 -1
  145. package/dist/types/chunks/index-entry-DtEbVpOG.d.cts +0 -47
  146. package/dist/types/chunks/index-entry-UD4dvtKh.d.ts +0 -47
  147. package/dist/types/chunks/progress-7KKiXXfX.d.ts +0 -405
  148. package/dist/types/chunks/progress-By8yFaUE.d.cts +0 -405
  149. package/dist/types/chunks/reflog-entry-BbNnXCTC.d.cts +0 -368
  150. package/dist/types/chunks/reflog-entry-CSzjnZd4.d.ts +0 -368
  151. package/dist/types/chunks/write-tree-C3oNxOlX.d.cts +0 -196
  152. package/dist/types/chunks/write-tree-DRI-LzSr.d.ts +0 -196
@@ -0,0 +1,1122 @@
1
+ import { o as FileMode, aN as IndexEntry, G as GitIndex, B as BisectMidpoint, c as CatFileBatchOptions, C as CatFileBatchEntry, aM as ConfigScope, aO as ConfigKey, g as CreateCommitInput, m as DiffTreesInput, n as DiffTreesOptions, a2 as StatTreeDiff, a7 as TreeDiff, a6 as Tree, p as FlatTree, aQ as TreeEntry, U as ReadObjectOptions, b as Blob, r as GitObject, a as AuthorIdentity, aP as ReflogEntry, X as ResolveRefOptions, a9 as UpdateRefOptions, ab as WalkCommitsOptions, d as Commit, aa as WalkCommitsByDateOptions, ac as WalkSubmodulesOptions, a3 as SubmoduleEntry, ae as WalkTreeOptions, ad as WalkTreeEntry, ag as WalkWorkingTreeOptions, af as WalkWorkingTreeEntry } from './reflog-entry-BGJr9VfU.cjs';
2
+ import { F as FilePath, c as Context, O as ObjectId, R as RefName, j as HookName } from './context-D_A7-uau.cjs';
3
+ import { b as HttpTransport } from './http-transport-DirKfK2S.cjs';
4
+
5
+ /**
6
+ * The four states a git attribute can resolve to (`gitattributes(5)`):
7
+ *
8
+ * - `true` — set (`name`)
9
+ * - `false` — unset (`-name`)
10
+ * - `'unspecified'` — explicitly unspecified (`!name`)
11
+ * - `{ set: value }`— set to a string value (`name=value`)
12
+ */
13
+ type AttributeValue = true | false | 'unspecified' | {
14
+ readonly set: string;
15
+ };
16
+
17
+ /** A compiled glob — `test` reports whether a path matches the pattern. */
18
+ interface GlobMatcher {
19
+ test(path: string): boolean;
20
+ }
21
+
22
+ /** A single `.gitattributes` pattern line and the attributes it assigns. */
23
+ interface AttributeRule {
24
+ /** Pattern as written (post-unquote, pre-anchor-strip) — the round-trip source form. */
25
+ readonly pattern: string;
26
+ /** True when the pattern is anchored to the file's directory (leading or interior `/`). */
27
+ readonly anchored: boolean;
28
+ /** True when the pattern ends with `/` (directory-only). */
29
+ readonly directoryOnly: boolean;
30
+ /** 1-based source line number (tracks comment / blank gaps). */
31
+ readonly lineNumber: number;
32
+ /** Compiled glob, matched against a path relative to the source's basedir. */
33
+ readonly compiled: GlobMatcher;
34
+ /** Attribute assignments, last-token-wins within the line. */
35
+ readonly attributes: ReadonlyMap<string, AttributeValue>;
36
+ }
37
+
38
+ /** A macro name → the attributes it expands to. */
39
+ type MacroRegistry = ReadonlyMap<string, ReadonlyMap<string, AttributeValue>>;
40
+
41
+ /**
42
+ * One attributes file's rules, tagged with the directory it lives in. Patterns
43
+ * are matched against a path made relative to `basedir` (`''` is the repo root).
44
+ */
45
+ interface AttributeSource {
46
+ readonly basedir: string;
47
+ readonly rules: ReadonlyArray<AttributeRule>;
48
+ }
49
+
50
+ /** Resolves the precedence-ordered attribute sources + macro registry for a path. */
51
+ interface AttributeProvider {
52
+ readonly sourcesForPath: (path: FilePath) => Promise<{
53
+ readonly sources: ReadonlyArray<AttributeSource>;
54
+ readonly macros: MacroRegistry;
55
+ }>;
56
+ }
57
+
58
+ /** `true` ⇒ the path is in the sparse set (materialise it). */
59
+ type SparseMatcher = (path: FilePath) => boolean;
60
+
61
+ type WorkingTreeComparison = 'absent' | 'unchanged' | 'modified' | 'type-changed' | 'mode-changed';
62
+ /**
63
+ * A working-tree comparison plus the working file's mode (`mW`). `worktreeMode`
64
+ * is what `git status --porcelain=v2` reports for the worktree side; it is
65
+ * present whenever a working file exists and omitted only when the file is
66
+ * `absent`. There is no working blob oid — the file need not be in the object
67
+ * store, so git itself prints no `hW`.
68
+ */
69
+ interface WorkingTreeDelta {
70
+ readonly status: WorkingTreeComparison;
71
+ readonly worktreeMode?: FileMode;
72
+ }
73
+ declare const compareWorkingTreeDelta: (ctx: Context, entry: IndexEntry, provider?: AttributeProvider) => Promise<WorkingTreeDelta>;
74
+ /**
75
+ * Enum projection over {@link compareWorkingTreeDelta} — the dirtiness verdict
76
+ * without the mode. Consumed by the local-modification valve (`rm`, `stash`,
77
+ * clean-work-tree, apply-merge) where only the status matters.
78
+ */
79
+ declare const compareWorkingTreeEntry: (ctx: Context, entry: IndexEntry, provider?: AttributeProvider) => Promise<WorkingTreeComparison>;
80
+
81
+ /**
82
+ * Pure helper that diffs a current GitIndex against a target tree's flat
83
+ * entry list and emits an ordered ChangesetEntry list. No FS, no ctx; the
84
+ * impure write side lives in `apply-changeset.ts`.
85
+ *
86
+ * Stage-0 entries only — unmerged stages are invisible to checkout (Phase
87
+ * 13.1 design step 5).
88
+ */
89
+
90
+ interface ChangesetEntry {
91
+ readonly kind: 'add' | 'update' | 'delete' | 'noop';
92
+ readonly path: FilePath;
93
+ readonly mode: FileMode;
94
+ readonly id: ObjectId | undefined;
95
+ readonly previousId: ObjectId | undefined;
96
+ readonly previousMode: FileMode | undefined;
97
+ }
98
+ interface ChangesetStats {
99
+ readonly add: number;
100
+ readonly update: number;
101
+ readonly delete: number;
102
+ readonly noop: number;
103
+ }
104
+ interface Changeset {
105
+ readonly entries: ReadonlyArray<ChangesetEntry>;
106
+ readonly stats: ChangesetStats;
107
+ }
108
+ interface TargetEntry {
109
+ readonly path: FilePath;
110
+ readonly id: ObjectId;
111
+ readonly mode: FileMode;
112
+ }
113
+ declare const computeChangeset: (currentIndex: GitIndex, targetTree: ReadonlyArray<TargetEntry>) => Changeset;
114
+
115
+ interface ApplyChangesetOpts {
116
+ readonly changeset: Changeset;
117
+ readonly force: boolean;
118
+ readonly workdir: string;
119
+ }
120
+ interface ApplyChangesetResult {
121
+ readonly writtenEntries: ReadonlyArray<IndexEntry>;
122
+ readonly written: number;
123
+ readonly deleted: number;
124
+ }
125
+ /**
126
+ * `true` when a working-tree file exists at `absPath` but its blob content
127
+ * hash differs from `expectedId`. An absent file is not dirty. Shared by
128
+ * `applySparseCheckout`'s narrowing pre-scan (design §9).
129
+ */
130
+ declare const isWorkingTreeDirty: (ctx: Context, absPath: string, expectedId: string) => Promise<boolean>;
131
+ declare const applyChangeset: (ctx: Context, opts: ApplyChangesetOpts) => Promise<ApplyChangesetResult>;
132
+
133
+ /**
134
+ * Compute the bisect midpoint: the commit that halves the candidate set
135
+ * (commits reachable from `bad` but not from any `good`).
136
+ *
137
+ * Returns `undefined` when the candidate set is empty (the bug does not
138
+ * exist within the `good`→`bad` range, or `bad` is already `good`-reachable).
139
+ *
140
+ * Mirrors `git rev-list --bisect-vars` semantics; see `BisectMidpoint`.
141
+ */
142
+ declare const bisectMidpoint: (ctx: Context, good: ReadonlyArray<ObjectId>, bad: ObjectId) => Promise<BisectMidpoint | undefined>;
143
+
144
+ /**
145
+ * Project a target tree onto a fresh stage-0 IndexEntry list, preserving
146
+ * stat-cache fields from the prior index where the path's `id` AND `mode`
147
+ * both match (the "stat-cache donor" strategy).
148
+ *
149
+ * Pure with respect to the working tree: this primitive never calls
150
+ * `fs.lstat`, `fs.read`, or any working-tree-side API. It only reads git
151
+ * objects via `walkTree` → `readObject` for nested trees.
152
+ *
153
+ * Used by `reset --mixed` to rebuild the index from a target
154
+ * commit's tree. Will be re-used by `reset --hard` composed
155
+ * with `materializeTree` to also write the working tree.
156
+ *
157
+ * ## Preconditions
158
+ *
159
+ * `currentIndex` MUST be read under the same `acquireIndexLock` that will
160
+ * later commit the result. Reading the index BEFORE the lock is acquired
161
+ * lets a concurrent writer mutate it between the donor-map build and the
162
+ * commit, producing a result that reflects neither the pre-reset nor the
163
+ * post-reset state. See `reset.ts:rebuildIndexFromCommit` for the
164
+ * canonical pattern: acquire → read → build → commit → release-in-finally.
165
+ */
166
+
167
+ interface BuildIndexFromTreeOpts {
168
+ readonly targetTree: ObjectId;
169
+ readonly currentIndex: GitIndex;
170
+ /**
171
+ * Sparse-checkout filter. When supplied, an excluded path is rebuilt as a
172
+ * zero-stat skip-worktree entry and an in-pattern path has any stale
173
+ * skip-worktree bit cleared. `undefined` ⇒ sparse inactive — the rebuilt
174
+ * index is byte-identical to the non-sparse behaviour.
175
+ */
176
+ readonly sparse?: SparseMatcher;
177
+ }
178
+ declare const buildIndexFromTree: (ctx: Context, opts: BuildIndexFromTreeOpts) => Promise<ReadonlyArray<IndexEntry>>;
179
+
180
+ interface BuildPackInput {
181
+ readonly oids: ReadonlyArray<ObjectId>;
182
+ }
183
+ interface BuildPackResult {
184
+ readonly bytes: Uint8Array;
185
+ /** Hex SHA of the pack body, also the trailer (last 20 bytes). */
186
+ readonly sha: string;
187
+ readonly objectCount: number;
188
+ }
189
+ declare const buildPack: (ctx: Context, input: BuildPackInput) => Promise<BuildPackResult>;
190
+
191
+ declare function catFileBatch(ctx: Context, ids: AsyncIterable<ObjectId> | Iterable<ObjectId>, options?: CatFileBatchOptions): AsyncIterable<CatFileBatchEntry>;
192
+
193
+ /**
194
+ * Subset of `.git/config` that v1 commands consume. Only fields actually used by
195
+ * commands are typed — the parser ignores everything else (lenient, like git itself).
196
+ */
197
+ interface ParsedConfig {
198
+ readonly core?: {
199
+ readonly bare?: boolean;
200
+ readonly excludesFile?: string;
201
+ readonly attributesFile?: string;
202
+ readonly logAllRefUpdates?: boolean | 'always';
203
+ readonly hooksPath?: string;
204
+ /** `core.notesRef` — default notes ref when neither explicit arg nor `GIT_NOTES_REF` is set. */
205
+ readonly notesRef?: string;
206
+ readonly sparseCheckout?: boolean;
207
+ readonly sparseCheckoutCone?: boolean;
208
+ readonly looseCompression?: number;
209
+ };
210
+ readonly user?: {
211
+ readonly name: string;
212
+ readonly email: string;
213
+ };
214
+ readonly remote?: ReadonlyMap<string, {
215
+ readonly url?: string;
216
+ /** `remote.<name>.pushurl` — push-only URL; `push` reads `pushUrl ?? url`. */
217
+ readonly pushUrl?: string;
218
+ readonly fetch?: ReadonlyArray<string>;
219
+ /** `remote.<name>.promisor` — true when this is a partial-clone promisor remote. */
220
+ readonly promisor?: boolean;
221
+ /** `remote.<name>.partialclonefilter` — the canonical filter spec applied at clone. */
222
+ readonly partialCloneFilter?: string;
223
+ }>;
224
+ readonly branch?: ReadonlyMap<string, {
225
+ readonly remote?: string;
226
+ readonly merge?: string;
227
+ }>;
228
+ /** `[submodule "<name>"]` — the registered (initialised) submodules. */
229
+ readonly submodule?: ReadonlyMap<string, {
230
+ readonly url?: string;
231
+ readonly active?: boolean;
232
+ readonly update?: string;
233
+ }>;
234
+ /** `[merge "<driver>"]` — configured custom merge drivers. */
235
+ readonly merge?: ReadonlyMap<string, {
236
+ readonly name?: string;
237
+ readonly driver?: string;
238
+ readonly recursive?: string;
239
+ }>;
240
+ /** `[diff "<name>"]` configured diff/textconv drivers. */
241
+ readonly diff?: ReadonlyMap<string, {
242
+ readonly textconv?: string;
243
+ readonly cachetextconv?: boolean;
244
+ }>;
245
+ /** `[filter "<name>"]` configured clean/smudge filter drivers. */
246
+ readonly filter?: ReadonlyMap<string, {
247
+ readonly clean?: string;
248
+ readonly smudge?: string;
249
+ readonly process?: string;
250
+ readonly required?: boolean;
251
+ }>;
252
+ /** `[extensions]` — `partialClone` names the promisor remote of a partial clone. */
253
+ readonly extensions?: {
254
+ readonly partialClone?: string;
255
+ };
256
+ }
257
+ /**
258
+ * Read and cache `${gitDir}/config`. Missing → empty config (not an error).
259
+ *
260
+ * The cache is keyed on `Context` identity; a new context (e.g., after a write
261
+ * that re-creates the repo) gets a fresh read. Concurrent calls share the same
262
+ * in-flight promise (per-context single-flight).
263
+ */
264
+ declare const readConfig: (ctx: Context) => Promise<ParsedConfig>;
265
+ /**
266
+ * Drop the cached `readConfig` entry for a single `Context`. The production
267
+ * invalidator: a config write (`updateCoreConfig`) calls this so a subsequent
268
+ * `readConfig` on the same context re-reads the file instead of serving the
269
+ * stale parse.
270
+ */
271
+ declare const invalidateConfigCache: (ctx: Context) => void;
272
+ interface ValuelessEntry {
273
+ readonly key: string;
274
+ readonly source: string;
275
+ readonly line: number;
276
+ }
277
+ /**
278
+ * Cold-path detection: re-tokenize the repo-local config and return the FIRST
279
+ * valueless (`value === null`) entry, by config-file line, whose key
280
+ * (case-insensitive) is one of `keys` and which sits under `[<section> "<subsection>"]`
281
+ * (subsection `undefined` ⇒ the section with no subsection). Returns the fully-qualified
282
+ * key, the absolute config path, and the 1-based line, or `undefined` when no such
283
+ * entry exists. Runs ONLY on a command's refusal path.
284
+ */
285
+ declare const findFirstValuelessEntry: (ctx: Context, section: string, subsection: string | undefined, keys: ReadonlyArray<string>) => Promise<ValuelessEntry | undefined>;
286
+ /**
287
+ * One `[section "subsection"]` block of a git-config-format INI file: the
288
+ * section name, an optional quoted subsection, and its key/value entries.
289
+ * Exported so `.gitmodules` parsing — byte-identical grammar — reuses one
290
+ * tokenizer (ADR-086).
291
+ *
292
+ * Entry `value`:
293
+ * - `string` — key present with `=` (possibly `''` for `key =`)
294
+ * - `null` — key present with no `=` (git's internal NULL; boolean-true)
295
+ * - `undefined` is never used here; the absent-key state lives one layer up
296
+ */
297
+ interface IniSection {
298
+ readonly section: string;
299
+ readonly subsection: string | undefined;
300
+ readonly entries: ReadonlyArray<{
301
+ readonly key: string;
302
+ readonly value: string | null;
303
+ }>;
304
+ }
305
+ /**
306
+ * Tokenize git-config-format INI text into its sections. Lenient on structure,
307
+ * like git is with unknown keys: orphan key/values and malformed headers are
308
+ * skipped. Values follow git's full quoted-value grammar — quotes stripped,
309
+ * `\n`/`\t`/`\b`/`\"`/`\\` decoded, backslash-newline continuations, unquoted
310
+ * `#`/`;` starting comments — and a malformed value (unknown escape, unclosed
311
+ * quote) throws `CONFIG_PARSE_ERROR` with its 1-based physical line and the
312
+ * optional `source` label, mirroring git's `bad config line N in file F`
313
+ * refusal. A malformed quoted-subsection header (e.g. `[s"a"]`, `[s "a" x]`,
314
+ * unclosed quote) also throws `CONFIG_PARSE_ERROR` with `partialSectionName`.
315
+ *
316
+ * Keys before the first header are recorded under an implicit orphan section
317
+ * (`section: ''`, `subsection: undefined`), so they surface on the token stream
318
+ * and porcelain `--list`, mirroring git, which dumps them with no section prefix
319
+ * but refuses to address them. The orphan section is emitted only when it
320
+ * gathered an entry — a header-only file yields no leading empty section.
321
+ *
322
+ * A line with no `=` records a valueless key (`value: null`); the key grammar
323
+ * (alpha-first, `[a-zA-Z0-9-]`, then space/TAB and `=`-or-EOL) refuses anything
324
+ * else — `bad!key`, `9key`, a mid-key `#`/`;` — with `CONFIG_PARSE_ERROR`.
325
+ */
326
+ declare const parseIniSections: (text: string, source?: string) => ReadonlyArray<IniSection>;
327
+
328
+ /**
329
+ * Drop the per-scope sections cache for a single `Context`. Called by
330
+ * `invalidateConfigCache` in `config-read.ts` so writers can invalidate both
331
+ * caches atomically.
332
+ */
333
+ declare const invalidateScopedConfigCache: (ctx: Context) => void;
334
+ /**
335
+ * Read the raw IniSection array for a single config scope, or a scope-tagged
336
+ * flat array merged in precedence order (`system → global → local → worktree`)
337
+ * when `scope` is omitted.
338
+ *
339
+ * Per-Context, per-scope cached: a second call with the same `(ctx, scope)`
340
+ * shares the in-flight promise of the first. `invalidateConfigCache(ctx)` (from
341
+ * `config-read.ts`) drops the cached entries here too.
342
+ *
343
+ * In the merged-read path (`scope` omitted), scopes that are unavailable on
344
+ * the current adapter (`CONFIG_SCOPE_NOT_AVAILABLE`, `CONFIG_SYSTEM_PATH_UNRESOLVED`)
345
+ * are silently skipped — the caller gets whatever scopes the adapter can
346
+ * actually surface. Single-scope calls raise instead, so the caller can react
347
+ * to a missing scope explicitly.
348
+ */
349
+ declare const readConfigSections: ({ ctx, scope, }: {
350
+ readonly ctx: Context;
351
+ readonly scope?: ConfigScope;
352
+ }) => Promise<ReadonlyArray<{
353
+ readonly scope: ConfigScope;
354
+ readonly section: IniSection;
355
+ }>>;
356
+ /**
357
+ * Look up a single value for a fully-qualified key (`section.name` or
358
+ * `section.subsection.name`). Behaviour:
359
+ *
360
+ * - When `scope` is provided, reads only that scope. If the key has more than
361
+ * one match in that scope, throws `CONFIG_MULTIPLE_VALUES` (carries `scope`).
362
+ * - When `scope` is omitted, merges across the four scopes. Same multi-value
363
+ * throw if more than one entry matches anywhere across the merged view
364
+ * (without the `scope` discriminator).
365
+ * - Absent key: returns `{ key, value: undefined }`; never throws.
366
+ * - Valueless key (no `=` in the file): returns `{ key, value: null, scope }`.
367
+ * `null` (present, no `=`) is distinct from `undefined` (absent) and from
368
+ * `''` (empty string after `key =`).
369
+ *
370
+ * Branding: the returned `key` is the caller's input cast to `ConfigKey`;
371
+ * `parseConfigKey` validates the string before this cast, so the brand is
372
+ * load-bearing only at the type level.
373
+ */
374
+ declare const getConfigValue: ({ ctx, key, scope, }: {
375
+ readonly ctx: Context;
376
+ readonly key: string;
377
+ readonly scope?: ConfigScope;
378
+ }) => Promise<{
379
+ readonly key: ConfigKey;
380
+ readonly value: string | null;
381
+ readonly scope: ConfigScope;
382
+ } | {
383
+ readonly key: ConfigKey;
384
+ readonly value: undefined;
385
+ }>;
386
+ /**
387
+ * Look up every value for a key. Returns matches in scope-precedence order
388
+ * (and physical-file order within each scope). Empty array when the key is
389
+ * absent. Never throws on multi-value.
390
+ *
391
+ * Each `value` carries `string | null`: `null` means the entry was present
392
+ * with no `=` (git's internal NULL); `undefined` is never in the array.
393
+ */
394
+ declare const getAllConfigValues: ({ ctx, key, scope, }: {
395
+ readonly ctx: Context;
396
+ readonly key: string;
397
+ readonly scope?: ConfigScope;
398
+ }) => Promise<{
399
+ readonly key: ConfigKey;
400
+ readonly values: ReadonlyArray<{
401
+ readonly value: string | null;
402
+ readonly scope: ConfigScope;
403
+ }>;
404
+ }>;
405
+
406
+ declare function createCommit(ctx: Context, input: CreateCommitInput): Promise<ObjectId>;
407
+
408
+ declare function diffTrees(ctx: Context, a: DiffTreesInput, b: DiffTreesInput, options: DiffTreesOptions & {
409
+ withStat: true;
410
+ }): Promise<StatTreeDiff>;
411
+ declare function diffTrees(ctx: Context, a: DiffTreesInput, b: DiffTreesInput, options?: DiffTreesOptions): Promise<TreeDiff>;
412
+
413
+ interface EnumerateObjectsOptions {
414
+ /** Include objects from pack files (default: true). */
415
+ readonly includePacks?: boolean;
416
+ }
417
+ declare function enumerateObjects(ctx: Context, opts?: EnumerateObjectsOptions): Promise<ReadonlyArray<ObjectId>>;
418
+
419
+ /**
420
+ * push closure walker.
421
+ *
422
+ * Enumerates every object the remote does NOT have so the caller can
423
+ * stream them into `buildPack`. Walks commits from `wants` with `haves`
424
+ * as the boundary (canonical `until` semantics — the haves themselves
425
+ * are never yielded), then walks each commit's tree for the trees and
426
+ * blobs they reference. Duplicates are removed across the whole stream
427
+ * via a single `Set<ObjectId>`.
428
+ *
429
+ * Annotated tags pushed via a refspec must appear in the stream too —
430
+ * `readObject` is called on each want; if the result is a Tag, the tag
431
+ * oid is yielded and the chain is followed (tag → tag →... → commit)
432
+ * before handing the resolved commit oid to `walkCommits`.
433
+ *
434
+ * Gitlink entries in a tree (submodules) are NOT included: the oid
435
+ * names a commit that lives in another repository, which we cannot
436
+ * resolve locally and have no business including in this push's pack.
437
+ */
438
+
439
+ interface EnumeratePushObjectsInput {
440
+ /**
441
+ * Object ids the caller wants on the remote. Each MUST resolve to a
442
+ * commit or an annotated tag (tags are unwrapped to commits before the
443
+ * commit walk).
444
+ */
445
+ readonly wants: ReadonlyArray<ObjectId>;
446
+ /** Object ids the remote already has (server's advertised ref tips). */
447
+ readonly haves: ReadonlyArray<ObjectId>;
448
+ /** Hard cap on objects emitted. Defaults to MAX_PUSH_OBJECTS. */
449
+ readonly maxObjects?: number;
450
+ }
451
+ declare function enumeratePushObjects(ctx: Context, input: EnumeratePushObjectsInput): AsyncIterable<ObjectId>;
452
+
453
+ /**
454
+ * Enumerate every current ref: `HEAD`, loose refs under `.git/refs/**`, and
455
+ * packed-refs entries — deduplicated. Used by `reflog expire` to seed the
456
+ * reachable-commit walk; not on any hot path.
457
+ */
458
+
459
+ declare function enumerateRefs(ctx: Context): Promise<ReadonlyArray<RefName>>;
460
+
461
+ interface FetchPackInput {
462
+ /** Advertised refs the caller wants. MUST be non-empty (server-side requirement). */
463
+ readonly wants: ReadonlyArray<ObjectId>;
464
+ /** Objects the caller already has (negotiation). Empty for clone, populated for fetch. */
465
+ readonly haves: ReadonlyArray<ObjectId>;
466
+ /** Negotiated capabilities (intersection of advertised + supported). */
467
+ readonly capabilities: ReadonlyArray<string>;
468
+ /** Base remote URL (the same URL passed to clone). */
469
+ readonly url: string;
470
+ /** Progress op label — clone uses 'clone:write-objects', fetch uses 'fetch:write-objects'. */
471
+ readonly progressOp: string;
472
+ /**
473
+ * Shallow clone depth. When set, sends `deepen N` and consumes the
474
+ * accompanying `shallow <oid>` / `unshallow <oid>` response block.
475
+ *
476
+ */
477
+ readonly depth?: number;
478
+ /**
479
+ * Partial-clone object filter — a canonical filter spec. When set, a
480
+ * `filter` line is emitted; the caller must have negotiated the `filter`
481
+ * capability.
482
+ */
483
+ readonly filter?: string;
484
+ /**
485
+ * When true, write an empty `pack-<sha>.promisor` sentinel beside the pack
486
+ * so the objects it references but omits are treated as promised.
487
+ */
488
+ readonly promisor?: boolean;
489
+ }
490
+ interface FetchPackResult {
491
+ readonly packPath: string;
492
+ readonly idxPath: string;
493
+ readonly objectCount: number;
494
+ /** Hex-encoded SHA of the pack trailer; also the on-disk filename stem. */
495
+ readonly packSha: string;
496
+ /** Commits the server advertised as new shallow boundaries (empty when depth is unset). */
497
+ readonly shallow: ReadonlyArray<ObjectId>;
498
+ /** Commits the server advertised as no-longer-shallow (empty when depth is unset). */
499
+ readonly unshallow: ReadonlyArray<ObjectId>;
500
+ }
501
+ declare const fetchPack: (ctx: Context, transport: HttpTransport, input: FetchPackInput) => Promise<FetchPackResult>;
502
+
503
+ /**
504
+ * Flatten a nested `Tree` into the `FlatTree` shape that the `mergeTrees`
505
+ * domain primitive (and the recursive tree-diff) consume.
506
+ *
507
+ * Bridges `walkTree`'s iterator into the `FlatTree` Map of
508
+ * `path → { id, mode }`. Accepts either an oid or an already-resolved `Tree`
509
+ * object (the recursive diff passes the latter to avoid a redundant root read);
510
+ * `walkTree` resolves both. Consumed by `merge.ts`'s clean-merge tree walk,
511
+ * `rm`'s HEAD-vs-index staged-change check, and the `diffTrees` recursive path,
512
+ * so it is exported from the primitives barrel.
513
+ *
514
+ * Pure with respect to the working tree — only reads git objects via
515
+ * `walkTree`.
516
+ */
517
+
518
+ declare const flattenTree: (ctx: Context, treeIdOrObject: ObjectId | Tree) => Promise<FlatTree>;
519
+
520
+ interface HashBlobOptions {
521
+ /** Persist the loose object under `.git/objects/<2>/<38>`. Default `false`. */
522
+ readonly write?: boolean;
523
+ }
524
+ declare const hashBlob: (ctx: Context, content: Uint8Array, opts?: HashBlobOptions) => Promise<ObjectId>;
525
+
526
+ interface IsIgnoredQuery {
527
+ readonly path: FilePath;
528
+ /** Match directory rules (`build/`). Defaults to `false`. */
529
+ readonly isDirectory?: boolean;
530
+ }
531
+ interface IsIgnoredMatchSource {
532
+ readonly kind: 'global' | 'info' | 'gitignore';
533
+ /** POSIX-relative directory whose file carried the rule. `''` for global / info / repo-root gitignore. */
534
+ readonly basedir: FilePath | '';
535
+ /** 1-based line number of the matching rule inside its file. */
536
+ readonly line: number;
537
+ /** Raw pattern text (e.g. `*.log`, `!keep.log`, `build/`). */
538
+ readonly pattern: string;
539
+ }
540
+ interface IsIgnoredMatch {
541
+ readonly path: FilePath;
542
+ readonly ignored: boolean;
543
+ /** Set only when `ignored === true`. */
544
+ readonly source?: IsIgnoredMatchSource;
545
+ }
546
+ declare const isIgnored: (ctx: Context, queries: ReadonlyArray<IsIgnoredQuery>) => Promise<ReadonlyArray<IsIgnoredMatch>>;
547
+
548
+ /**
549
+ * Lazily reads an on-disk fanout subtree's entries on demand. Injected by the
550
+ * caller so the trie stays pure: the I/O lives outside the domain.
551
+ */
552
+ type SubtreeReader = (oid: ObjectId) => Promise<ReadonlyArray<TreeEntry>>;
553
+ interface EmptySlot {
554
+ readonly kind: 'empty';
555
+ }
556
+ interface NoteSlot {
557
+ readonly kind: 'note';
558
+ readonly key: ObjectId;
559
+ readonly val: ObjectId;
560
+ }
561
+ interface SubtreeSlot {
562
+ readonly kind: 'subtree';
563
+ readonly prefix: string;
564
+ readonly oid: ObjectId;
565
+ }
566
+ interface InternalSlot {
567
+ readonly kind: 'internal';
568
+ readonly node: NotesTrie;
569
+ }
570
+ type Slot = EmptySlot | NoteSlot | SubtreeSlot | InternalSlot;
571
+ /** A 16-way nibble-trie node: one slot per hex value of the oid at this depth. */
572
+ interface NotesTrie {
573
+ readonly slots: ReadonlyArray<Slot>;
574
+ readonly preserved: ReadonlyArray<TreeEntry>;
575
+ }
576
+
577
+ interface LoadedNotesTree {
578
+ /** The trie built from the on-disk notes tree. Empty when the ref is absent. */
579
+ readonly trie: NotesTrie;
580
+ /** Reads a subtree's entries on demand (lazy subtree unpacking). */
581
+ readonly read: SubtreeReader;
582
+ /** The commit oid the notes ref resolved to, or `undefined` if the ref did not exist. */
583
+ readonly notesCommitOid: ObjectId | undefined;
584
+ /** The notes commit's root tree oid, or `undefined` if the ref did not exist. */
585
+ readonly notesTreeOid: ObjectId | undefined;
586
+ }
587
+ /**
588
+ * Resolves a notes ref to its commit, reads the commit's tree, and builds a
589
+ * `NotesTrie` via the domain's `loadTrieRoot`. Returns an empty trie when the
590
+ * ref does not exist yet.
591
+ *
592
+ * The returned `read` function acts as the lazy subtree reader: passing it to
593
+ * the domain's write-plan walker lets it unpack fanout subtrees on demand.
594
+ */
595
+ declare function loadNotesTree(ctx: Context, ref: RefName): Promise<LoadedNotesTree>;
596
+
597
+ /**
598
+ * Compose `walkTree → computeChangeset → applyChangeset` to update the
599
+ * working tree to a target tree's contents.
600
+ *
601
+ * - Branch switch mode: `paths === undefined` — diff the entire current
602
+ * index against the entire target tree.
603
+ * - Path-restore mode: `paths !== undefined` — restrict both sides of
604
+ * the diff to those paths.
605
+ *
606
+ * Returns the new IndexEntry list for the caller to commit, plus
607
+ * written/deleted counts. The primitive does NOT commit the index — the
608
+ * caller decides.
609
+ *
610
+ * ## Stat-source contract for `newIndexEntries` (load-bearing for)
611
+ *
612
+ * - **Paths that were written/added** (`add` or `update` changeset entries):
613
+ * the IndexEntry carries **post-write `lstat`-derived stat fields**
614
+ * (ctime/mtime/dev/ino/uid/gid/fileSize). These reflect the file we just
615
+ * wrote, so the next `status` runs the fast `isStatClean` path.
616
+ * - **Paths whose changeset classification was `noop`** (skipped — index
617
+ * already matched target by `id + mode`): the IndexEntry is the caller's
618
+ * `currentIndex` entry verbatim. Donor stats survive across the call.
619
+ * - `reset --hard` therefore MUST set `forceRewriteAll: true` so every noop
620
+ * upgrades to update and the post-write stats land in the output. Without
621
+ * that, a locally-modified working-tree file that the index still records
622
+ * as clean would survive the reset, AND the donor stats would be stale
623
+ * relative to the actual disk state.
624
+ */
625
+
626
+ interface MaterializeTreeOpts {
627
+ readonly targetTree: ObjectId;
628
+ readonly currentIndex: GitIndex;
629
+ readonly force?: boolean;
630
+ readonly paths?: ReadonlySet<FilePath>;
631
+ /**
632
+ * When true, every target-tree path is written to the working tree
633
+ * unconditionally — even paths the index→target diff classified as `noop`
634
+ * (same `id` AND `mode`). Required by `reset --hard`, where the working
635
+ * tree may diverge from the index (uncommitted local modifications); the
636
+ * standard index→target diff cannot see that drift, so noops would skip
637
+ * paths the caller wants overwritten. Default `false` keeps the Phase
638
+ * 13.1 checkout behaviour: clean files are never spuriously rewritten.
639
+ */
640
+ readonly forceRewriteAll?: boolean;
641
+ /**
642
+ * Branch-switch sparse-checkout filter. Honoured ONLY when `paths` is
643
+ * undefined. A target-tree path the matcher rejects is NOT written to the
644
+ * working tree; its `newIndexEntries` record carries `skipWorktree: true`
645
+ * (the index keeps every path — git-faithful). A path the matcher accepts
646
+ * that the *current* index records as skip-worktree (absent on disk) is
647
+ * materialised even when its `id` matches, because the current index is
648
+ * filtered to drop skip-worktree entries before the diff — such a path
649
+ * classifies as `add`, never `noop`.
650
+ */
651
+ readonly sparse?: SparseMatcher;
652
+ }
653
+ interface MaterializeTreeResult {
654
+ readonly newIndexEntries: ReadonlyArray<IndexEntry>;
655
+ readonly written: number;
656
+ readonly deleted: number;
657
+ }
658
+ declare const materializeTree: (ctx: Context, opts: MaterializeTreeOpts) => Promise<MaterializeTreeResult>;
659
+
660
+ declare const materializeWorktreeFromHead: (ctx: Context) => Promise<MaterializeTreeResult>;
661
+
662
+ interface MergeBaseOptions {
663
+ readonly all?: boolean;
664
+ readonly octopus?: boolean;
665
+ }
666
+ /**
667
+ * Compute merge bases — the best common ancestors of the given commits.
668
+ *
669
+ * `commits[0]` is `one`, the rest are the others. Returns the lexicographically
670
+ * smallest single base by default; the full reduced set with `{ all: true }`;
671
+ * the octopus fold with `{ octopus: true }`. Unrelated histories yield `[]`.
672
+ */
673
+ declare const mergeBase: (ctx: Context, commits: readonly ObjectId[], options?: MergeBaseOptions) => Promise<readonly ObjectId[]>;
674
+
675
+ /**
676
+ * Pure path helpers composing `ctx.layout.gitDir` with known sub-paths.
677
+ * No I/O. No port access. Primitive step 3.
678
+ */
679
+
680
+ /**
681
+ * Repository working-tree root. Returns the workDir from the current context;
682
+ * facade-tier code is responsible for discovery / realpath pinning
683
+ * at construction time. Primitives consume the already-resolved path.
684
+ */
685
+ declare const getRepoRoot: (ctx: Context) => FilePath;
686
+ declare const sparseCheckoutPath: (gitDir: string) => string;
687
+
688
+ declare function readBlob(ctx: Context, id: ObjectId, options?: ReadObjectOptions): Promise<Blob>;
689
+
690
+ /**
691
+ * Resolve HEAD's commit tree as a `FlatTree` (`path → { id, mode }`), or
692
+ * `undefined` for an unborn HEAD (no commits yet). This is git's HEAD-tree side
693
+ * of `diff-index` — the staged column compares it against the index.
694
+ *
695
+ * Tolerates an unborn HEAD by catching `REF_NOT_FOUND` (the symbolic ref points
696
+ * at a branch with no commit). A HEAD that resolves to a non-commit object is a
697
+ * corrupt repository and throws `unexpectedObjectType`.
698
+ *
699
+ * Pure with respect to the working tree — only reads git objects (via
700
+ * `resolveRef` / `readObject` / `flattenTree`).
701
+ */
702
+
703
+ declare const readHeadTree: (ctx: Context) => Promise<FlatTree | undefined>;
704
+
705
+ declare function readIndex(ctx: Context): Promise<GitIndex>;
706
+
707
+ declare function readObject(ctx: Context, id: ObjectId, options?: ReadObjectOptions): Promise<GitObject>;
708
+
709
+ /**
710
+ * Hard cap on the `.git/info/sparse-checkout` file — 1 MiB, mirroring
711
+ * `MAX_GITIGNORE_BYTES`. A plain literal (not `1024 * 1024`) so a boundary test
712
+ * keyed on the constant cannot drift with an arithmetic mutation of it.
713
+ */
714
+ declare const MAX_SPARSE_PATTERN_FILE_BYTES = 1048576;
715
+ /**
716
+ * Read `.git/info/sparse-checkout` as UTF-8 text. An absent file yields
717
+ * `undefined`; a file whose byte length exceeds
718
+ * `MAX_SPARSE_PATTERN_FILE_BYTES` throws `SPARSE_PATTERN_FILE_TOO_LARGE`
719
+ * (checked before decode so an over-cap file never reaches the decoder).
720
+ */
721
+ declare const readSparsePatternText: (ctx: Context) => Promise<string | undefined>;
722
+ /**
723
+ * Build the sparse matcher for the current repository. Returns `undefined`
724
+ * when `core.sparseCheckout` is falsy/absent — sparse is inactive and callers
725
+ * behave exactly as a non-sparse repo. When active, the matcher is parsed in
726
+ * the mode `core.sparseCheckoutCone` dictates; a cone file that degrades to
727
+ * non-cone matching logs one warning.
728
+ */
729
+ declare const loadSparseMatcher: (ctx: Context) => Promise<SparseMatcher | undefined>;
730
+
731
+ declare function readTree(ctx: Context, ref: RefName | ObjectId): Promise<Tree>;
732
+
733
+ /**
734
+ * Committer identity for reflog entries: config `user.*` plus a fresh
735
+ * timestamp, or a portable fallback when `user.*` is unset. Never throws —
736
+ * reflog logging must not abort a ref update.
737
+ */
738
+ declare function resolveReflogIdentity(ctx: Context): Promise<AuthorIdentity>;
739
+
740
+ /**
741
+ * Thin I/O layer over `.git/logs/<ref>` reflog files. Append is the hot path;
742
+ * whole-file rewrite and delete back the `reflog` command's expire / delete.
743
+ */
744
+
745
+ /** Append one entry to `ref`'s reflog, creating the file and parents as needed. */
746
+ declare function appendReflog(ctx: Context, ref: RefName, entry: ReflogEntry): Promise<void>;
747
+ /** Read `ref`'s reflog, oldest-first. Returns `[]` when the file is absent. */
748
+ declare function readReflog(ctx: Context, ref: RefName): Promise<ReadonlyArray<ReflogEntry>>;
749
+ /** Whether `ref` has a reflog file at all. */
750
+ declare function reflogExists(ctx: Context, ref: RefName): Promise<boolean>;
751
+ /** Replace `ref`'s reflog with exactly `entries`. Used by expire / delete. */
752
+ declare function writeReflog(ctx: Context, ref: RefName, entries: ReadonlyArray<ReflogEntry>): Promise<void>;
753
+ /** Remove `ref`'s reflog file. A no-op when the file is already absent. */
754
+ declare function deleteReflog(ctx: Context, ref: RefName): Promise<void>;
755
+ /** Every reflog under `.git/logs/`, each as the `RefName` it logs. */
756
+ declare function listReflogs(ctx: Context): Promise<ReadonlyArray<RefName>>;
757
+
758
+ /** The default notes namespace git uses when no override is in effect. */
759
+ declare const DEFAULT_NOTES_REF: RefName;
760
+ /**
761
+ * Resolves the notes ref to use for a notes operation.
762
+ *
763
+ * Precedence (highest first):
764
+ * 1. Explicit `ref` argument (git `--ref`) — expanded under `refs/notes/`
765
+ * 2. `GIT_NOTES_REF` environment variable — verbatim, refused if outside
766
+ * 3. `core.notesRef` git config value — verbatim, refused if outside
767
+ * 4. `refs/notes/commits` (hard-coded default)
768
+ *
769
+ * The resolved name is validated as a legal ref name before being returned.
770
+ */
771
+ declare function resolveNotesRef(ctx: Context, ref?: string): Promise<RefName>;
772
+
773
+ declare function resolveRef(ctx: Context, name: RefName | 'HEAD', options?: ResolveRefOptions): Promise<ObjectId>;
774
+
775
+ /** Optional arguments and stdin a caller threads into a hook invocation. */
776
+ interface HookInput {
777
+ readonly args?: ReadonlyArray<string>;
778
+ readonly stdin?: string;
779
+ }
780
+ /**
781
+ * Run a blocking git hook through `ctx.hooks`. A no-op when no `HookRunner` is
782
+ * wired (browser, or opted out), when the hook file is absent / not executable
783
+ * (`skipped`), or when the hook exits 0. Throws `HOOK_FAILED` on a non-zero
784
+ * exit — the caller's signal to abort the operation.
785
+ */
786
+ declare const runHook: (ctx: Context, name: HookName, input?: HookInput) => Promise<void>;
787
+ /**
788
+ * Run an informational (`post-*`) git hook — fire-and-forget. The operation has
789
+ * already completed, so git ignores a post-hook's exit code (it cannot abort);
790
+ * tsgit does the same: absent runner, `skipped`, or any exit code → no throw,
791
+ * no return value. The runner never rejects, so this only ever resolves.
792
+ */
793
+ declare const runInformationalHook: (ctx: Context, name: HookName, input?: HookInput) => Promise<void>;
794
+
795
+ /**
796
+ * Read `.git/shallow`. Returns an empty set when the file does not exist or
797
+ * contains no oids. Malformed lines are tolerated (skipped) — canonical
798
+ * git behaves the same; a corrupted shallow file should not block a fetch.
799
+ */
800
+ declare const readShallow: (ctx: Context) => Promise<ReadonlySet<ObjectId>>;
801
+ interface ShallowUpdate {
802
+ readonly shallow: ReadonlyArray<ObjectId>;
803
+ readonly unshallow: ReadonlyArray<ObjectId>;
804
+ }
805
+ /**
806
+ * Apply a set of shallow / unshallow updates to `.git/shallow`. Writes
807
+ * atomically via lock-rename; deletes the file when the resulting set is
808
+ * empty.
809
+ */
810
+ declare const updateShallow: (ctx: Context, updates: ShallowUpdate) => Promise<void>;
811
+
812
+ interface StreamBlobOptions {
813
+ readonly verifyHash?: boolean;
814
+ }
815
+ interface BlobStream extends AsyncIterable<Uint8Array> {
816
+ readonly materialised: boolean;
817
+ }
818
+ declare function streamBlob(ctx: Context, id: ObjectId, options?: StreamBlobOptions): Promise<BlobStream>;
819
+
820
+ /**
821
+ * Synthesise a nested `Tree` object from a flat `GitIndex` and return the
822
+ * root tree's `ObjectId`. Sub-trees are written to the object store as a
823
+ * side-effect of the recursive descent — only stage-0 entries contribute.
824
+ *
825
+ * Used by `checkout({ paths, source: 'index' })` to restore
826
+ * the working tree from staged content even when the index has diverged
827
+ * from HEAD via `add` / `rm`. The previous placeholder fell back to
828
+ * HEAD's tree, which silently lost the divergence.
829
+ *
830
+ * The synthesis is the inverse of `buildIndexFromTree`:
831
+ * "tree → index" and "index → tree" form a round-trip identity for any
832
+ * stage-0-only index.
833
+ *
834
+ * Pure with respect to the working tree — never calls `fs.lstat`,
835
+ * `fs.read`, or any working-tree-side API. Only writes git objects via
836
+ * the existing `writeTree` primitive.
837
+ *
838
+ * ## Safety
839
+ *
840
+ * - **Path validation**:.7 hoisted segment-level validation into
841
+ * `parseIndex` (`src/domain/git-index/path-validator.ts`). Every
842
+ * `IndexEntry` reaching this primitive THROUGH THE CANONICAL PARSER
843
+ * carries a `FilePath` value already free of `..`, `.`, empty segments,
844
+ * and leading-slash absolute paths. However, the primitive is also
845
+ * reachable from callers that construct `IndexEntry` records outside
846
+ * the parser (test fixtures, in-memory adapters, future synthesisers).
847
+ * Defence-in-depth: every entry is re-validated here so the primitive
848
+ * stays safe even when the parser-trusted path is bypassed.
849
+ * - **Depth cap**: synthesis bounds recursion at `MAX_TREE_DEPTH` (4096,
850
+ * matching git's canonical limit). The cap is enforced at the input
851
+ * boundary by counting slashes — by the time recursion would catch a
852
+ * pathological depth, the JS engine has already exhausted its call
853
+ * stack. Path validation does NOT subsume this check: a path can be
854
+ * safe segment-by-segment (no `..`/`.`/empty) and still be 10 000
855
+ * levels deep.
856
+ */
857
+
858
+ /**
859
+ * Public entry: pass the `entries` array directly (typically
860
+ * `index.entries`, but callers holding a filtered list may supply it
861
+ * without wrapping in a fake `GitIndex`).
862
+ */
863
+ declare const synthesizeTreeFromIndex: (ctx: Context, entries: ReadonlyArray<IndexEntry>) => Promise<ObjectId>;
864
+
865
+ /**
866
+ * Section-level surgery for `.git/config`: rename-section and remove-section.
867
+ * These operations match headers by their raw dotted name (byte-exact,
868
+ * case-sensitive) and rewrite or drop them without touching any other byte.
869
+ *
870
+ * @writes
871
+ * surface: config
872
+ * kind: readback-only
873
+ * format: git-config-text
874
+ */
875
+
876
+ /**
877
+ * Rename headers matching `oldName` (raw byte-exact dotted name) to the new
878
+ * section shape derived from `newName` (parsed via `parseNewSectionName`).
879
+ * The old name is never validated — any string is a legal lookup key; a miss
880
+ * throws `CONFIG_SECTION_NOT_FOUND` carrying the raw input verbatim. Throws
881
+ * `INVALID_OPTION` when the new subsection contains a LF or NUL.
882
+ */
883
+ declare const renameConfigSection: ({ ctx, oldName, newName, scope, }: {
884
+ readonly ctx: Context;
885
+ readonly oldName: string;
886
+ readonly newName: string;
887
+ readonly scope?: ConfigScope;
888
+ }) => Promise<void>;
889
+ /**
890
+ * Delete headers matching `sectionName` (raw byte-exact dotted name) and their
891
+ * bodies. The name is never validated — any string is a legal lookup key (e.g.
892
+ * `'remote'`, `'s.'`, `''`); a miss throws `CONFIG_SECTION_NOT_FOUND` carrying
893
+ * the raw input verbatim. For the trailing-dot and empty-name forms see
894
+ * `rawSectionName` and `removeConfigSectionInText` documentation.
895
+ */
896
+ declare const removeConfigSection: ({ ctx, sectionName, scope, }: {
897
+ readonly ctx: Context;
898
+ readonly sectionName: string;
899
+ readonly scope?: ConfigScope;
900
+ }) => Promise<void>;
901
+
902
+ /**
903
+ * Targeted `.git/config` writer: entry-level surgery that preserves comments,
904
+ * blank lines, key order, casing of unrelated keys, and every other section
905
+ * byte-for-byte. Writes one `key = value` per call under any
906
+ * `[section]` / `[section "subsection"]`.
907
+ *
908
+ * @writes
909
+ * surface: config
910
+ * kind: readback-only
911
+ * format: git-config-text
912
+ */
913
+
914
+ /**
915
+ * Set `key` under `[section]` / `[section "subsection"]`, preserving every
916
+ * other byte verbatim.
917
+ *
918
+ * - existing section with that key ⇒ full span of the first match is replaced
919
+ * by a single canonical `\t<key> = <value>` line;
920
+ * - existing section without that key ⇒ a `\t<key> = <value>` line is
921
+ * inserted at the end of the last matching block;
922
+ * - no such section ⇒ `[section]\n\t<key> = <value>\n` is appended.
923
+ */
924
+ declare const setConfigEntryInText: (text: string, section: string, subsection: string | undefined, key: string, value: string) => string;
925
+ /** `setConfigEntryInText` bound to the `[core]` section — kept for legacy callers. */
926
+ declare const setCoreConfigEntryInText: (text: string, key: string, value: string) => string;
927
+ /** One `key = value` write under `[section]` / `[section "subsection"]`. */
928
+ interface ConfigEntry {
929
+ readonly section: string;
930
+ readonly subsection?: string;
931
+ readonly key: string;
932
+ readonly value: string;
933
+ }
934
+ /**
935
+ * Read `${gitDir}/config` (a missing file is treated as `''`), fold
936
+ * `setConfigEntryInText` over `entries`, write the result, and invalidate the
937
+ * per-`Context` `readConfig` cache so a later read sees the new values.
938
+ */
939
+ declare const updateConfigEntries: (ctx: Context, entries: ReadonlyArray<ConfigEntry>) => Promise<void>;
940
+ /** Fold a batch of `[core]` `key = value` writes via `updateConfigEntries`. */
941
+ declare const updateCoreConfig: (ctx: Context, entries: Record<string, string>) => Promise<void>;
942
+ /**
943
+ * Mixed-operation batch entry. Folded over the on-disk text in order in
944
+ * a single `writeUtf8`. Use this when `remote` CRUD needs a section-
945
+ * remove paired with branch-referrer key removals in one atomic write.
946
+ */
947
+ type ConfigOperation = {
948
+ readonly kind: 'set';
949
+ readonly section: string;
950
+ readonly subsection?: string;
951
+ readonly key: string;
952
+ readonly value: string;
953
+ } | {
954
+ /**
955
+ * Insert a fresh `key = value` line at the end of the last matching
956
+ * section block WITHOUT replacing any existing entry with the same key.
957
+ * Use for multi-value keys (`fetch`) where every call must yield an
958
+ * additional line.
959
+ */
960
+ readonly kind: 'appendEntry';
961
+ readonly section: string;
962
+ readonly subsection?: string;
963
+ readonly key: string;
964
+ readonly value: string;
965
+ } | {
966
+ /**
967
+ * Remove every entry span for `key` from the section, pruning the block
968
+ * header if no entries or comments remain. Delegates to `removeConfigEntry`.
969
+ */
970
+ readonly kind: 'removeEntry';
971
+ readonly section: string;
972
+ readonly subsection?: string;
973
+ readonly key: string;
974
+ } | {
975
+ readonly kind: 'removeSection';
976
+ readonly section: string;
977
+ readonly subsection?: string;
978
+ } | {
979
+ readonly kind: 'renameSection';
980
+ readonly section: string;
981
+ readonly from: string;
982
+ readonly to: string;
983
+ };
984
+ declare const applyConfigOpInText: (text: string, op: ConfigOperation) => string;
985
+ /**
986
+ * Write a single `key = value` entry into the config file for the given scope
987
+ * (default `'local'`). Re-runs of the same call with a different value
988
+ * overwrite the existing entry in place (preserving comments and surrounding
989
+ * content). The key is validated via `parseConfigKey` (throws
990
+ * `CONFIG_KEY_INVALID` on a malformed input) and the value is validated by
991
+ * `assertValueSafe` (throws `CONFIG_VALUE_INVALID` on a banned control char)
992
+ * BEFORE any I/O — a rejected input never touches the file system.
993
+ *
994
+ * The branding on `ConfigKey` is enforced at the type level; this primitive
995
+ * accepts a raw string and parses it internally so it can be used directly
996
+ * from porcelain wrappers that hold un-branded callers' input.
997
+ */
998
+ declare const setConfigEntry: ({ ctx, key, value, scope, }: {
999
+ readonly ctx: Context;
1000
+ readonly key: string;
1001
+ readonly value: string;
1002
+ readonly scope?: ConfigScope;
1003
+ }) => Promise<void>;
1004
+ /**
1005
+ * Remove a single `key = value` entry from the given scope. Idempotent — if
1006
+ * the key is absent the call is a no-op (no I/O). If the key appears more
1007
+ * than once in the targeted scope, throws `CONFIG_MULTIPLE_VALUES` with
1008
+ * `requested: 'remove'` (the caller should use `unsetAllConfigEntries` to
1009
+ * clear every occurrence). An emptied section block is pruned entirely
1010
+ * (header + blank lines removed) unless the block contains a comment.
1011
+ */
1012
+ declare const unsetConfigEntry: ({ ctx, key, scope, }: {
1013
+ readonly ctx: Context;
1014
+ readonly key: string;
1015
+ readonly scope?: ConfigScope;
1016
+ }) => Promise<void>;
1017
+ /**
1018
+ * Remove every occurrence of `key` from the targeted scope. Idempotent — a
1019
+ * missing key produces no I/O. Unlike `unsetConfigEntry`, multi-valued keys
1020
+ * are explicitly supported: all matching spans are removed in a single
1021
+ * read-modify-write pass. An emptied section block is pruned entirely
1022
+ * (header + blank lines removed) unless the block contains a comment.
1023
+ */
1024
+ declare const unsetAllConfigEntries: ({ ctx, key, scope, }: {
1025
+ readonly ctx: Context;
1026
+ readonly key: string;
1027
+ readonly scope?: ConfigScope;
1028
+ }) => Promise<void>;
1029
+
1030
+ declare function updateRef(ctx: Context, name: RefName, newId: ObjectId, options: UpdateRefOptions): Promise<void>;
1031
+
1032
+ declare function walkCommits(ctx: Context, options: WalkCommitsOptions): AsyncIterable<Commit>;
1033
+
1034
+ /**
1035
+ * Walk every commit reachable from `from` across **all** parents, yielding them
1036
+ * in commit-date priority order — newest committer date first, oid-ascending on
1037
+ * ties. A thin wrapper over the shared {@link commitDateWalk} core: it owns the
1038
+ * public `INVALID_WALK_INPUT` seed contract (empty / too-many seeds) and
1039
+ * delegates the all-parents traversal. The core's first-parent variant is
1040
+ * internal — no public consumer needs date + first-parent yet (`log` routes
1041
+ * `--first-parent` through `walkCommits`'s lazy FIFO).
1042
+ */
1043
+ declare function walkCommitsByDate(ctx: Context, options: WalkCommitsByDateOptions): AsyncIterable<Commit>;
1044
+
1045
+ /**
1046
+ * Yield every gitlink reachable in `ref`'s tree, joined with its `.gitmodules`
1047
+ * metadata. With `recursive: true`, descend into each nested submodule whose
1048
+ * absorbed gitdir (`${gitDir}/modules/<name>`) is locally available; nested
1049
+ * yields carry `depth >= 1` and a `parent` path. Uninitialised / missing /
1050
+ * cyclic nested submodules contribute their own entry but no children — the
1051
+ * absence of further yields is the signal, matching `git submodule status
1052
+ * --recursive`.
1053
+ */
1054
+ declare function walkSubmodules(ctx: Context, options?: WalkSubmodulesOptions): AsyncIterable<SubmoduleEntry>;
1055
+
1056
+ declare function walkTree(ctx: Context, treeIdOrObject: ObjectId | Tree, options?: WalkTreeOptions): AsyncIterable<WalkTreeEntry>;
1057
+
1058
+ /**
1059
+ * Depth-first walk of the working tree starting at `ctx.layout.workDir`.
1060
+ *
1061
+ * Yields leaf entries (files and symlinks) as `{ path, stat }`. Directories
1062
+ * are descended into, not yielded. `.git` at any level is skipped
1063
+ * (case-insensitive, NTFS-trimmed). Embedded repositories (directories
1064
+ * containing a `.git` child) are skipped entirely — yields nothing under
1065
+ * them. Symlinks are surfaced via `lstat` (no follow); a symlink to a
1066
+ * directory is yielded as a leaf, not descended into.
1067
+ *
1068
+ * The host repository's own `.git` is NOT treated as an embedded-repo
1069
+ * marker — at the workDir root we only skip the `.git` entry itself, not
1070
+ * the workDir.
1071
+ */
1072
+ declare function walkWorkingTree(ctx: Context, options?: WalkWorkingTreeOptions): AsyncIterable<WalkWorkingTreeEntry>;
1073
+
1074
+ interface WriteNotesTreeInput {
1075
+ /** The in-memory trie to serialize. */
1076
+ readonly trie: NotesTrie;
1077
+ /** Subtree reader for lazy unpacking during write-plan generation. */
1078
+ readonly read: SubtreeReader;
1079
+ /** The notes commit the new commit should descend from, or `undefined` for a root commit. */
1080
+ readonly prevCommitOid: ObjectId | undefined;
1081
+ /** The notes commit message (caller owns the verb, e.g. "Notes added by 'git notes add'"). */
1082
+ readonly message: string;
1083
+ /** The identity used as both author and committer of the notes commit. */
1084
+ readonly author: AuthorIdentity;
1085
+ }
1086
+ /**
1087
+ * Converts a notes trie into a git commit:
1088
+ * 1. Walks the trie to produce a flat write-plan.
1089
+ * 2. Converts the flat plan into a real git tree hierarchy (bottom-up).
1090
+ * 3. Creates a notes commit (author == committer == the caller-resolved identity).
1091
+ *
1092
+ * Identity resolution lives in the calling command (`resolveCurrentIdentity`);
1093
+ * this primitive stays config-free. The caller is responsible for updating the
1094
+ * notes ref and reflog after this returns.
1095
+ */
1096
+ declare function writeNotesTree(ctx: Context, input: WriteNotesTreeInput): Promise<ObjectId>;
1097
+
1098
+ declare function writeObject(ctx: Context, object: GitObject): Promise<ObjectId>;
1099
+
1100
+ /**
1101
+ * Write the `.git/info/sparse-checkout` pattern file. The command tier
1102
+ * computes the text (via `serializeCone` or raw non-cone lines); this
1103
+ * primitive only persists it (design §7.3).
1104
+ *
1105
+ * @writes
1106
+ * surface: sparseCheckoutFile
1107
+ * kind: byte-identical
1108
+ * format: git-sparse-checkout
1109
+ */
1110
+
1111
+ /**
1112
+ * Persist `text` to `.git/info/sparse-checkout`. The `.git/info` directory is
1113
+ * created defensively first — `writeUtf8` creates parents on every adapter,
1114
+ * but an explicit `mkdir` keeps the contract clear and survives adapters that
1115
+ * tighten that guarantee.
1116
+ */
1117
+ declare const writeSparsePatternText: (ctx: Context, text: string) => Promise<void>;
1118
+
1119
+ declare function writeTree(ctx: Context, entries: ReadonlyArray<TreeEntry>): Promise<ObjectId>;
1120
+
1121
+ export { getRepoRoot as $, DEFAULT_NOTES_REF as D, compareWorkingTreeEntry as G, computeChangeset as J, createCommit as K, MAX_SPARSE_PATTERN_FILE_BYTES as M, deleteReflog as N, diffTrees as O, enumerateObjects as Q, enumeratePushObjects as R, enumerateRefs as T, fetchPack as U, findFirstValuelessEntry as X, flattenTree as Y, getAllConfigValues as Z, getConfigValue as _, hashBlob as a0, invalidateConfigCache as a1, invalidateScopedConfigCache as a2, isIgnored as a3, isWorkingTreeDirty as a4, listReflogs as a5, loadNotesTree as a6, loadSparseMatcher as a7, materializeTree as a8, materializeWorktreeFromHead as a9, unsetAllConfigEntries as aA, unsetConfigEntry as aB, updateConfigEntries as aC, updateCoreConfig as aD, updateRef as aE, updateShallow as aF, walkCommits as aG, walkCommitsByDate as aH, walkSubmodules as aI, walkTree as aJ, walkWorkingTree as aK, writeNotesTree as aL, writeObject as aM, writeReflog as aN, writeSparsePatternText as aO, writeTree as aP, mergeBase as aa, parseIniSections as ab, readBlob as ac, readConfig as ad, readConfigSections as ae, readHeadTree as af, readIndex as ag, readObject as ah, readReflog as ai, readShallow as aj, readSparsePatternText as ak, readTree as al, reflogExists as am, removeConfigSection as an, renameConfigSection as ao, resolveNotesRef as ap, resolveRef as aq, resolveReflogIdentity as ar, runHook as as, runInformationalHook as at, setConfigEntry as au, setConfigEntryInText as av, setCoreConfigEntryInText as aw, sparseCheckoutPath as ax, streamBlob as ay, synthesizeTreeFromIndex as az, appendReflog as s, applyChangeset as t, applyConfigOpInText as u, bisectMidpoint as v, buildIndexFromTree as w, buildPack as x, catFileBatch as y, compareWorkingTreeDelta as z };
1122
+ export type { ApplyChangesetOpts as A, BlobStream as B, Changeset as C, EnumerateObjectsOptions as E, FetchPackInput as F, HashBlobOptions as H, IniSection as I, LoadedNotesTree as L, ParsedConfig as P, StreamBlobOptions as S, ValuelessEntry as V, WorkingTreeComparison as W, ApplyChangesetResult as a, GlobMatcher as aQ, BuildIndexFromTreeOpts as b, BuildPackInput as c, BuildPackResult as d, ChangesetEntry as e, ChangesetStats as f, ConfigEntry as g, EnumeratePushObjectsInput as h, FetchPackResult as i, HookInput as j, IsIgnoredMatch as k, IsIgnoredMatchSource as l, IsIgnoredQuery as m, MaterializeTreeOpts as n, MaterializeTreeResult as o, MergeBaseOptions as p, WorkingTreeDelta as q, WriteNotesTreeInput as r };