@scolladon/tsgit 1.3.0 → 2.0.1
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.
- package/README.md +3 -2
- package/dist/cjs/adapters/browser/index.cjs +1 -1
- package/dist/cjs/adapters/memory/index.cjs +1 -1
- package/dist/cjs/adapters/memory/index.cjs.map +1 -1
- package/dist/cjs/adapters/node/index.cjs +1 -1
- package/dist/cjs/chunks/adapter-detect-CD_LcgaH.cjs +2 -0
- package/dist/cjs/chunks/adapter-detect-CD_LcgaH.cjs.map +1 -0
- package/dist/cjs/chunks/{browser-http-transport-D4NH-8oJ.cjs → browser-http-transport-CiMRqtDS.cjs} +2 -2
- package/dist/cjs/chunks/browser-http-transport-CiMRqtDS.cjs.map +1 -0
- package/dist/cjs/chunks/error-CfjFO3x_.cjs +2 -0
- package/dist/cjs/chunks/error-CfjFO3x_.cjs.map +1 -0
- package/dist/cjs/chunks/index-BWCq_5BJ.cjs +2 -0
- package/dist/cjs/chunks/index-BWCq_5BJ.cjs.map +1 -0
- package/dist/cjs/chunks/memory-http-transport-BVL6VgB-.cjs +2 -0
- package/dist/cjs/chunks/memory-http-transport-BVL6VgB-.cjs.map +1 -0
- package/dist/cjs/chunks/node-http-transport-BvfVcf02.cjs +2 -0
- package/dist/cjs/chunks/node-http-transport-BvfVcf02.cjs.map +1 -0
- package/dist/cjs/chunks/{progress-Bj2w-90A.cjs → progress-CxU62NC1.cjs} +2 -2
- package/dist/cjs/chunks/{progress-Bj2w-90A.cjs.map → progress-CxU62NC1.cjs.map} +1 -1
- package/dist/cjs/chunks/repository-BEg2zNtx.cjs +2 -0
- package/dist/cjs/chunks/repository-BEg2zNtx.cjs.map +1 -0
- package/dist/cjs/chunks/walk-submodules-D2Sp7JEB.cjs +2 -0
- package/dist/cjs/chunks/walk-submodules-D2Sp7JEB.cjs.map +1 -0
- package/dist/cjs/commands/index.cjs +1 -1
- package/dist/cjs/index.browser.cjs +1 -1
- package/dist/cjs/index.browser.cjs.map +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/index.default.cjs +1 -1
- package/dist/cjs/index.default.cjs.map +1 -1
- package/dist/cjs/index.node.cjs +1 -1
- package/dist/cjs/index.node.cjs.map +1 -1
- package/dist/cjs/primitives/index.cjs +1 -1
- package/dist/cjs/primitives/index.cjs.map +1 -1
- package/dist/esm/adapters/browser/index.js +1 -1
- package/dist/esm/adapters/memory/index.js +1 -1
- package/dist/esm/adapters/memory/index.js.map +1 -1
- package/dist/esm/adapters/node/index.js +1 -1
- package/dist/esm/adapters/node/index.js.map +1 -1
- package/dist/esm/chunks/adapter-detect-DkZhhUhd.js +2 -0
- package/dist/esm/chunks/adapter-detect-DkZhhUhd.js.map +1 -0
- package/dist/esm/chunks/{browser-http-transport-DL8bkNdg.js → browser-http-transport-4rJkHcQu.js} +2 -2
- package/dist/esm/chunks/browser-http-transport-4rJkHcQu.js.map +1 -0
- package/dist/esm/chunks/error-Dc-SRSJK.js +2 -0
- package/dist/esm/chunks/error-Dc-SRSJK.js.map +1 -0
- package/dist/esm/chunks/index-jH0UMhh-.js +2 -0
- package/dist/esm/chunks/index-jH0UMhh-.js.map +1 -0
- package/dist/esm/chunks/memory-http-transport-CA1WxWBp.js +2 -0
- package/dist/esm/chunks/memory-http-transport-CA1WxWBp.js.map +1 -0
- package/dist/esm/chunks/node-http-transport-DPa2lK3T.js +2 -0
- package/dist/esm/chunks/node-http-transport-DPa2lK3T.js.map +1 -0
- package/dist/esm/chunks/progress-BZobfl7p.js +2 -0
- package/dist/esm/chunks/{progress-NePjO3Kd.js.map → progress-BZobfl7p.js.map} +1 -1
- package/dist/esm/chunks/repository-DF6ePd1x.js +2 -0
- package/dist/esm/chunks/repository-DF6ePd1x.js.map +1 -0
- package/dist/esm/chunks/walk-submodules-Dq9oGwP8.js +2 -0
- package/dist/esm/chunks/walk-submodules-Dq9oGwP8.js.map +1 -0
- package/dist/esm/commands/index.js +1 -1
- package/dist/esm/index.browser.js +1 -1
- package/dist/esm/index.browser.js.map +1 -1
- package/dist/esm/index.default.js +1 -1
- package/dist/esm/index.default.js.map +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/index.node.js +1 -1
- package/dist/esm/index.node.js.map +1 -1
- package/dist/esm/primitives/index.js +1 -1
- package/dist/esm/primitives/index.js.map +1 -1
- package/dist/types/adapters/browser/index.d.cts +5 -2
- package/dist/types/adapters/browser/index.d.ts +5 -2
- package/dist/types/adapters/memory/index.d.cts +17 -2
- package/dist/types/adapters/memory/index.d.ts +17 -2
- package/dist/types/adapters/node/index.d.cts +5 -2
- package/dist/types/adapters/node/index.d.ts +5 -2
- package/dist/types/chunks/{context-BORy7yXb.d.ts → context-CCL0_F8R.d.ts} +65 -39
- package/dist/types/chunks/{context-CMrHCVwK.d.cts → context-YDw6qicq.d.cts} +65 -39
- package/dist/types/chunks/{http-transport-DirKfK2S.d.cts → http-transport--_NdQOiw.d.cts} +1 -1
- package/dist/types/chunks/{http-transport-DirKfK2S.d.ts → http-transport--_NdQOiw.d.ts} +1 -1
- package/dist/types/chunks/index-entry-DtEbVpOG.d.cts +47 -0
- package/dist/types/chunks/index-entry-UD4dvtKh.d.ts +47 -0
- package/dist/types/chunks/progress-7KKiXXfX.d.ts +405 -0
- package/dist/types/chunks/progress-By8yFaUE.d.cts +405 -0
- package/dist/types/chunks/{reflog-entry-C2Hsdobk.d.ts → reflog-entry-BbNnXCTC.d.cts} +17 -3
- package/dist/types/chunks/{reflog-entry-DNvSz7S5.d.cts → reflog-entry-CSzjnZd4.d.ts} +17 -3
- package/dist/types/chunks/{repository-DCR_3RVt.d.cts → repository-BeifCqp0.d.cts} +48 -8
- package/dist/types/chunks/{repository-DFxFeYi3.d.ts → repository-FoS_Laoy.d.ts} +48 -8
- package/dist/types/chunks/{write-tree-CuhpWKFo.d.cts → write-tree-C3oNxOlX.d.cts} +78 -46
- package/dist/types/chunks/{write-tree-Dn1LtIh7.d.ts → write-tree-DRI-LzSr.d.ts} +78 -46
- package/dist/types/commands/index.d.cts +826 -95
- package/dist/types/commands/index.d.ts +826 -95
- package/dist/types/index.browser.d.cts +7 -6
- package/dist/types/index.browser.d.ts +7 -6
- package/dist/types/index.d.cts +278 -53
- package/dist/types/index.d.ts +278 -53
- package/dist/types/index.default.d.cts +7 -6
- package/dist/types/index.default.d.ts +7 -6
- package/dist/types/index.node.d.cts +7 -6
- package/dist/types/index.node.d.ts +7 -6
- package/dist/types/primitives/index.d.cts +260 -12
- package/dist/types/primitives/index.d.ts +260 -12
- package/dist/types/transport/index.d.cts +1 -1
- package/dist/types/transport/index.d.ts +1 -1
- package/package.json +25 -18
- package/dist/cjs/chunks/browser-http-transport-D4NH-8oJ.cjs.map +0 -1
- package/dist/cjs/chunks/error-CDLOBdNU.cjs +0 -2
- package/dist/cjs/chunks/error-CDLOBdNU.cjs.map +0 -1
- package/dist/cjs/chunks/index-BVArBKuk.cjs +0 -2
- package/dist/cjs/chunks/index-BVArBKuk.cjs.map +0 -1
- package/dist/cjs/chunks/index-DE9HSiWf.cjs +0 -2
- package/dist/cjs/chunks/index-DE9HSiWf.cjs.map +0 -1
- package/dist/cjs/chunks/logger-CVG0zcPH.cjs +0 -2
- package/dist/cjs/chunks/logger-CVG0zcPH.cjs.map +0 -1
- package/dist/cjs/chunks/memory-http-transport-DXwDGKtR.cjs +0 -2
- package/dist/cjs/chunks/memory-http-transport-DXwDGKtR.cjs.map +0 -1
- package/dist/cjs/chunks/node-http-transport-vrbnNEDb.cjs +0 -2
- package/dist/cjs/chunks/node-http-transport-vrbnNEDb.cjs.map +0 -1
- package/dist/cjs/chunks/repository-BJwTSiGf.cjs +0 -2
- package/dist/cjs/chunks/repository-BJwTSiGf.cjs.map +0 -1
- package/dist/esm/chunks/browser-http-transport-DL8bkNdg.js.map +0 -1
- package/dist/esm/chunks/error-MOmSzp9Z.js +0 -2
- package/dist/esm/chunks/error-MOmSzp9Z.js.map +0 -1
- package/dist/esm/chunks/index-BjmofbKE.js +0 -2
- package/dist/esm/chunks/index-BjmofbKE.js.map +0 -1
- package/dist/esm/chunks/index-Jh5R-UmU.js +0 -2
- package/dist/esm/chunks/index-Jh5R-UmU.js.map +0 -1
- package/dist/esm/chunks/logger-DP2cCpvL.js +0 -2
- package/dist/esm/chunks/logger-DP2cCpvL.js.map +0 -1
- package/dist/esm/chunks/memory-http-transport-COJU6VOL.js +0 -2
- package/dist/esm/chunks/memory-http-transport-COJU6VOL.js.map +0 -1
- package/dist/esm/chunks/node-http-transport-DYCFIJbc.js +0 -2
- package/dist/esm/chunks/node-http-transport-DYCFIJbc.js.map +0 -1
- package/dist/esm/chunks/progress-NePjO3Kd.js +0 -2
- package/dist/esm/chunks/repository-Cs-dbHqO.js +0 -2
- package/dist/esm/chunks/repository-Cs-dbHqO.js.map +0 -1
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import { add,
|
|
2
|
-
import {
|
|
3
|
-
import { c as catFileBatch, a as createCommit, d as diffTrees, g as getRepoRoot, m as mergeBase, r as readBlob, b as readIndex, e as readObject, f as readTree,
|
|
4
|
-
import {
|
|
1
|
+
import { abortMerge, add, BranchNamespace, catFile, checkout, CherryPickNamespace, clone, commit, ConfigNamespace, continueMerge, DiffOptions, PatchResult, fetch, fetchMissing, init, log, merge, mv, pull, push, RebaseNamespace, reflog, RemoteNamespace, reset, RevertNamespace, revParse, rm, SparseCheckoutNamespace, StashNamespace, status, submodules, TagNamespace } from '../commands/index.js';
|
|
2
|
+
import { F as FileSystem, H as HashService, C as Compressor, R as RepositoryConfig, L as Logger, P as ProgressReporter, a as HookRunner, b as Context } from './context-CCL0_F8R.js';
|
|
3
|
+
import { c as catFileBatch, a as createCommit, d as diffTrees, g as getRepoRoot, h as hashBlob, i as isIgnored, m as mergeBase, r as readBlob, b as readIndex, e as readObject, f as readTree, j as recordRefUpdate, k as resolveRef, l as runHook, s as setEntryFlags, n as stageEntry, u as unstageEntry, o as updateRef, w as walkCommits, p as walkSubmodules, q as walkTree, t as walkWorkingTree, v as writeObject, x as writeSymbolicRef, y as writeTree } from './write-tree-DRI-LzSr.js';
|
|
4
|
+
import { H as HttpTransport } from './http-transport--_NdQOiw.js';
|
|
5
|
+
import { T as TreeDiff } from './reflog-entry-CSzjnZd4.js';
|
|
6
|
+
import { S as SnapshotFactory } from './progress-7KKiXXfX.js';
|
|
5
7
|
|
|
6
8
|
/**
|
|
7
9
|
* Helper that strips the leading `Context` parameter from a function type so
|
|
@@ -52,32 +54,60 @@ interface OpenRepositoryOptions {
|
|
|
52
54
|
* users never see Context except through `repo.ctx`.
|
|
53
55
|
*/
|
|
54
56
|
interface Repository {
|
|
57
|
+
readonly abortMerge: BindCtx<typeof abortMerge>;
|
|
55
58
|
readonly add: BindCtx<typeof add>;
|
|
56
|
-
|
|
59
|
+
/** Nested `repo.branch.{list,create,delete,rename}` namespace. */
|
|
60
|
+
readonly branch: BranchNamespace;
|
|
57
61
|
readonly catFile: BindCtx<typeof catFile>;
|
|
58
62
|
readonly checkout: BindCtx<typeof checkout>;
|
|
63
|
+
/** Nested `repo.cherryPick.{run,continue,skip,abort}` namespace. */
|
|
64
|
+
readonly cherryPick: CherryPickNamespace;
|
|
59
65
|
readonly clone: BindCtx<typeof clone>;
|
|
60
66
|
readonly commit: BindCtx<typeof commit>;
|
|
61
|
-
|
|
67
|
+
/** Nested `repo.config.{get,set,unset,unsetAll,getAll,getRegexp,list,renameSection,removeSection}` (ADR-181). */
|
|
68
|
+
readonly config: ConfigNamespace;
|
|
69
|
+
readonly continueMerge: BindCtx<typeof continueMerge>;
|
|
70
|
+
readonly diff: {
|
|
71
|
+
(opts?: DiffOptions & {
|
|
72
|
+
format?: 'tree';
|
|
73
|
+
}): Promise<TreeDiff>;
|
|
74
|
+
(opts: DiffOptions & {
|
|
75
|
+
format: 'patch';
|
|
76
|
+
}): Promise<PatchResult>;
|
|
77
|
+
};
|
|
62
78
|
readonly fetch: BindCtx<typeof fetch>;
|
|
63
79
|
readonly fetchMissing: BindCtx<typeof fetchMissing>;
|
|
64
80
|
readonly init: BindCtx<typeof init>;
|
|
65
81
|
readonly log: BindCtx<typeof log>;
|
|
66
82
|
readonly merge: BindCtx<typeof merge>;
|
|
83
|
+
readonly mv: BindCtx<typeof mv>;
|
|
84
|
+
readonly pull: BindCtx<typeof pull>;
|
|
67
85
|
readonly push: BindCtx<typeof push>;
|
|
86
|
+
/** Nested `repo.rebase.{run,continue,skip,abort}` namespace. */
|
|
87
|
+
readonly rebase: RebaseNamespace;
|
|
68
88
|
readonly reflog: BindCtx<typeof reflog>;
|
|
89
|
+
/** Nested `repo.remote.{list,add,remove,rename,setUrl,show}` namespace. */
|
|
90
|
+
readonly remote: RemoteNamespace;
|
|
69
91
|
readonly reset: BindCtx<typeof reset>;
|
|
92
|
+
/** Nested `repo.revert.{run,continue,skip,abort}` namespace. */
|
|
93
|
+
readonly revert: RevertNamespace;
|
|
70
94
|
readonly revParse: BindCtx<typeof revParse>;
|
|
71
95
|
readonly rm: BindCtx<typeof rm>;
|
|
72
|
-
|
|
96
|
+
/** Nested `repo.sparseCheckout.{list,set,add,reapply,disable}` namespace. */
|
|
97
|
+
readonly sparseCheckout: SparseCheckoutNamespace;
|
|
98
|
+
/** Nested `repo.stash.{push,list,apply,pop,drop}` namespace. */
|
|
99
|
+
readonly stash: StashNamespace;
|
|
73
100
|
readonly status: BindCtx<typeof status>;
|
|
74
101
|
readonly submodules: BindCtx<typeof submodules>;
|
|
75
|
-
|
|
102
|
+
/** Nested `repo.tag.{list,create,delete}` namespace. */
|
|
103
|
+
readonly tag: TagNamespace;
|
|
76
104
|
readonly primitives: {
|
|
77
105
|
readonly catFileBatch: BindCtx<typeof catFileBatch>;
|
|
78
106
|
readonly createCommit: BindCtx<typeof createCommit>;
|
|
79
107
|
readonly diffTrees: BindCtx<typeof diffTrees>;
|
|
80
108
|
readonly getRepoRoot: BindCtx<typeof getRepoRoot>;
|
|
109
|
+
readonly hashBlob: BindCtx<typeof hashBlob>;
|
|
110
|
+
readonly isIgnored: BindCtx<typeof isIgnored>;
|
|
81
111
|
readonly mergeBase: BindCtx<typeof mergeBase>;
|
|
82
112
|
readonly readBlob: BindCtx<typeof readBlob>;
|
|
83
113
|
readonly readIndex: BindCtx<typeof readIndex>;
|
|
@@ -86,6 +116,9 @@ interface Repository {
|
|
|
86
116
|
readonly recordRefUpdate: BindCtx<typeof recordRefUpdate>;
|
|
87
117
|
readonly resolveRef: BindCtx<typeof resolveRef>;
|
|
88
118
|
readonly runHook: BindCtx<typeof runHook>;
|
|
119
|
+
readonly setEntryFlags: BindCtx<typeof setEntryFlags>;
|
|
120
|
+
readonly stageEntry: BindCtx<typeof stageEntry>;
|
|
121
|
+
readonly unstageEntry: BindCtx<typeof unstageEntry>;
|
|
89
122
|
readonly updateRef: BindCtx<typeof updateRef>;
|
|
90
123
|
readonly walkCommits: BindCtx<typeof walkCommits>;
|
|
91
124
|
readonly walkSubmodules: BindCtx<typeof walkSubmodules>;
|
|
@@ -95,6 +128,13 @@ interface Repository {
|
|
|
95
128
|
readonly writeSymbolicRef: BindCtx<typeof writeSymbolicRef>;
|
|
96
129
|
readonly writeTree: BindCtx<typeof writeTree>;
|
|
97
130
|
};
|
|
131
|
+
/**
|
|
132
|
+
* Lazy snapshot factory wired to the cached resolver stack (Phase 20.1).
|
|
133
|
+
* Each method returns a `Snapshot` handle that performs no I/O until
|
|
134
|
+
* iterated; in-flight iterations are isolated from concurrent writes
|
|
135
|
+
* via the iteration-stability invariant (design §8.0 + ADR-150).
|
|
136
|
+
*/
|
|
137
|
+
readonly snapshot: SnapshotFactory;
|
|
98
138
|
/** The frozen Context backing every binding. Exposed for advanced use. */
|
|
99
139
|
readonly ctx: Context;
|
|
100
140
|
/**
|
|
@@ -1,38 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
interface IndexEntryFlags {
|
|
5
|
-
readonly assumeValid: boolean;
|
|
6
|
-
readonly stage: 0 | 1 | 2 | 3;
|
|
7
|
-
/** Index v3 extended flag — the path is intentionally absent from the working tree. */
|
|
8
|
-
readonly skipWorktree: boolean;
|
|
9
|
-
/** Index v3 extended flag — `git add -N` placeholder. Modelled for faithful round-tripping. */
|
|
10
|
-
readonly intentToAdd: boolean;
|
|
11
|
-
}
|
|
12
|
-
interface IndexEntry {
|
|
13
|
-
readonly ctimeSeconds: number;
|
|
14
|
-
readonly ctimeNanoseconds: number;
|
|
15
|
-
readonly mtimeSeconds: number;
|
|
16
|
-
readonly mtimeNanoseconds: number;
|
|
17
|
-
readonly dev: number;
|
|
18
|
-
readonly ino: number;
|
|
19
|
-
readonly mode: FileMode;
|
|
20
|
-
readonly uid: number;
|
|
21
|
-
readonly gid: number;
|
|
22
|
-
readonly fileSize: number;
|
|
23
|
-
readonly id: ObjectId;
|
|
24
|
-
readonly flags: IndexEntryFlags;
|
|
25
|
-
readonly path: FilePath;
|
|
26
|
-
}
|
|
27
|
-
interface IndexExtension {
|
|
28
|
-
readonly signature: string;
|
|
29
|
-
readonly data: Uint8Array;
|
|
30
|
-
}
|
|
31
|
-
interface GitIndex {
|
|
32
|
-
readonly version: 2 | 3;
|
|
33
|
-
readonly entries: ReadonlyArray<IndexEntry>;
|
|
34
|
-
readonly extensions: ReadonlyArray<IndexExtension>;
|
|
35
|
-
}
|
|
1
|
+
import { b as Context, O as ObjectId, c as FilePath, j as RefName, g as HookName } from './context-YDw6qicq.cjs';
|
|
2
|
+
import { d as CatFileBatchOptions, C as CatFileBatchEntry, e as CreateCommitInput, D as DiffTreesInput, f as DiffTreesOptions, T as TreeDiff, s as ReadObjectOptions, B as Blob, G as GitObject, a as Tree, t as ResolveRefOptions, F as FileMode, U as UpdateRefOptions, W as WalkCommitsOptions, E as Commit, v as WalkSubmodulesOptions, S as SubmoduleEntry, x as WalkTreeOptions, w as WalkTreeEntry, z as WalkWorkingTreeOptions, y as WalkWorkingTreeEntry, H as TreeEntry } from './reflog-entry-BbNnXCTC.cjs';
|
|
3
|
+
import { G as GitIndex, a as IndexEntryFlags, I as IndexEntry } from './index-entry-DtEbVpOG.cjs';
|
|
36
4
|
|
|
37
5
|
declare function catFileBatch(ctx: Context, ids: AsyncIterable<ObjectId> | Iterable<ObjectId>, options?: CatFileBatchOptions): AsyncIterable<CatFileBatchEntry>;
|
|
38
6
|
|
|
@@ -40,18 +8,46 @@ declare function createCommit(ctx: Context, input: CreateCommitInput): Promise<O
|
|
|
40
8
|
|
|
41
9
|
declare function diffTrees(ctx: Context, a: DiffTreesInput, b: DiffTreesInput, options?: DiffTreesOptions): Promise<TreeDiff>;
|
|
42
10
|
|
|
11
|
+
interface HashBlobOptions {
|
|
12
|
+
/** Persist the loose object under `.git/objects/<2>/<38>`. Default `false`. */
|
|
13
|
+
readonly write?: boolean;
|
|
14
|
+
}
|
|
15
|
+
declare const hashBlob: (ctx: Context, content: Uint8Array, opts?: HashBlobOptions) => Promise<ObjectId>;
|
|
16
|
+
|
|
17
|
+
interface IsIgnoredQuery {
|
|
18
|
+
readonly path: FilePath;
|
|
19
|
+
/** Match directory rules (`build/`). Defaults to `false`. */
|
|
20
|
+
readonly isDirectory?: boolean;
|
|
21
|
+
}
|
|
22
|
+
interface IsIgnoredMatchSource {
|
|
23
|
+
readonly kind: 'global' | 'info' | 'gitignore';
|
|
24
|
+
/** POSIX-relative directory whose file carried the rule. `''` for global / info / repo-root gitignore. */
|
|
25
|
+
readonly basedir: FilePath | '';
|
|
26
|
+
/** 1-based line number of the matching rule inside its file. */
|
|
27
|
+
readonly line: number;
|
|
28
|
+
/** Raw pattern text (e.g. `*.log`, `!keep.log`, `build/`). */
|
|
29
|
+
readonly pattern: string;
|
|
30
|
+
}
|
|
31
|
+
interface IsIgnoredMatch {
|
|
32
|
+
readonly path: FilePath;
|
|
33
|
+
readonly ignored: boolean;
|
|
34
|
+
/** Set only when `ignored === true`. */
|
|
35
|
+
readonly source?: IsIgnoredMatchSource;
|
|
36
|
+
}
|
|
37
|
+
declare const isIgnored: (ctx: Context, queries: ReadonlyArray<IsIgnoredQuery>) => Promise<ReadonlyArray<IsIgnoredMatch>>;
|
|
38
|
+
|
|
39
|
+
interface MergeBaseOptions {
|
|
40
|
+
readonly all?: boolean;
|
|
41
|
+
readonly octopus?: boolean;
|
|
42
|
+
}
|
|
43
43
|
/**
|
|
44
|
-
* Compute
|
|
45
|
-
*
|
|
46
|
-
* Algorithm: bidirectional BFS with two visited sets. After each layer
|
|
47
|
-
* advance, check the intersection. When non-empty, return the
|
|
48
|
-
* lexicographically smallest oid (deterministic tie-breaker).
|
|
44
|
+
* Compute merge bases — the best common ancestors of the given commits.
|
|
49
45
|
*
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
*
|
|
46
|
+
* `commits[0]` is `one`, the rest are the others. Returns the lexicographically
|
|
47
|
+
* smallest single base by default; the full reduced set with `{ all: true }`;
|
|
48
|
+
* the octopus fold with `{ octopus: true }`. Unrelated histories yield `[]`.
|
|
53
49
|
*/
|
|
54
|
-
declare const mergeBase: (ctx: Context,
|
|
50
|
+
declare const mergeBase: (ctx: Context, commits: readonly ObjectId[], options?: MergeBaseOptions) => Promise<readonly ObjectId[]>;
|
|
55
51
|
|
|
56
52
|
/**
|
|
57
53
|
* Pure path helpers composing `ctx.layout.gitDir` with known sub-paths.
|
|
@@ -102,6 +98,42 @@ interface HookInput {
|
|
|
102
98
|
*/
|
|
103
99
|
declare const runHook: (ctx: Context, name: HookName, input?: HookInput) => Promise<void>;
|
|
104
100
|
|
|
101
|
+
/**
|
|
102
|
+
* Flip flags (`assumeValid`, `skipWorktree`, `intentToAdd`) on an existing
|
|
103
|
+
* index entry without rehashing. Used by `stash pop`, `mv`, and other
|
|
104
|
+
* porcelain that need to restore flag state after a tree-level operation.
|
|
105
|
+
*
|
|
106
|
+
* The on-disk version is auto-promoted to v3 by `serializeIndex` whenever
|
|
107
|
+
* an extended flag flips true — nothing to manage at the primitive layer
|
|
108
|
+
* (ADR-164).
|
|
109
|
+
*/
|
|
110
|
+
|
|
111
|
+
interface SetEntryFlagsOptions {
|
|
112
|
+
readonly breakStaleLockMs?: number;
|
|
113
|
+
}
|
|
114
|
+
declare const setEntryFlags: (ctx: Context, path: FilePath, flags: Partial<IndexEntryFlags>, opts?: SetEntryFlagsOptions) => Promise<IndexEntry>;
|
|
115
|
+
|
|
116
|
+
type StageEntrySource = {
|
|
117
|
+
readonly content: Uint8Array;
|
|
118
|
+
readonly mode?: FileMode;
|
|
119
|
+
} | {
|
|
120
|
+
readonly id: ObjectId;
|
|
121
|
+
readonly mode: FileMode;
|
|
122
|
+
};
|
|
123
|
+
interface StageEntryOptions {
|
|
124
|
+
readonly breakStaleLockMs?: number;
|
|
125
|
+
/** Flags overlay on top of `STAGE0_FLAGS`. Use to seed `intentToAdd` etc. */
|
|
126
|
+
readonly flags?: Partial<IndexEntryFlags>;
|
|
127
|
+
}
|
|
128
|
+
declare const stageEntry: (ctx: Context, path: FilePath, source: StageEntrySource, opts?: StageEntryOptions) => Promise<IndexEntry>;
|
|
129
|
+
|
|
130
|
+
interface UnstageEntryOptions {
|
|
131
|
+
readonly breakStaleLockMs?: number;
|
|
132
|
+
}
|
|
133
|
+
declare const unstageEntry: (ctx: Context, path: FilePath, opts?: UnstageEntryOptions) => Promise<{
|
|
134
|
+
readonly removed: boolean;
|
|
135
|
+
}>;
|
|
136
|
+
|
|
105
137
|
declare function updateRef(ctx: Context, name: RefName, newId: ObjectId, options: UpdateRefOptions): Promise<void>;
|
|
106
138
|
|
|
107
139
|
declare function walkCommits(ctx: Context, options: WalkCommitsOptions): AsyncIterable<Commit>;
|
|
@@ -160,5 +192,5 @@ declare const writeSymbolicRef: (ctx: Context, name: RefName, target: RefName) =
|
|
|
160
192
|
|
|
161
193
|
declare function writeTree(ctx: Context, entries: ReadonlyArray<TreeEntry>): Promise<ObjectId>;
|
|
162
194
|
|
|
163
|
-
export { createCommit as a, readIndex as b, catFileBatch as c, diffTrees as d, readObject as e, readTree as f, getRepoRoot as g,
|
|
164
|
-
export type {
|
|
195
|
+
export { sparseCheckoutPath as E, createCommit as a, readIndex as b, catFileBatch as c, diffTrees as d, readObject as e, readTree as f, getRepoRoot as g, hashBlob as h, isIgnored as i, recordRefUpdate as j, resolveRef as k, runHook as l, mergeBase as m, stageEntry as n, updateRef as o, walkSubmodules as p, walkTree as q, readBlob as r, setEntryFlags as s, walkWorkingTree as t, unstageEntry as u, writeObject as v, walkCommits as w, writeSymbolicRef as x, writeTree as y };
|
|
196
|
+
export type { IsIgnoredMatchSource as A, IsIgnoredQuery as B, StageEntryOptions as C, StageEntrySource as D, HashBlobOptions as H, IsIgnoredMatch as I, SetEntryFlagsOptions as S, UnstageEntryOptions as U, HookInput as z };
|
|
@@ -1,38 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
interface IndexEntryFlags {
|
|
5
|
-
readonly assumeValid: boolean;
|
|
6
|
-
readonly stage: 0 | 1 | 2 | 3;
|
|
7
|
-
/** Index v3 extended flag — the path is intentionally absent from the working tree. */
|
|
8
|
-
readonly skipWorktree: boolean;
|
|
9
|
-
/** Index v3 extended flag — `git add -N` placeholder. Modelled for faithful round-tripping. */
|
|
10
|
-
readonly intentToAdd: boolean;
|
|
11
|
-
}
|
|
12
|
-
interface IndexEntry {
|
|
13
|
-
readonly ctimeSeconds: number;
|
|
14
|
-
readonly ctimeNanoseconds: number;
|
|
15
|
-
readonly mtimeSeconds: number;
|
|
16
|
-
readonly mtimeNanoseconds: number;
|
|
17
|
-
readonly dev: number;
|
|
18
|
-
readonly ino: number;
|
|
19
|
-
readonly mode: FileMode;
|
|
20
|
-
readonly uid: number;
|
|
21
|
-
readonly gid: number;
|
|
22
|
-
readonly fileSize: number;
|
|
23
|
-
readonly id: ObjectId;
|
|
24
|
-
readonly flags: IndexEntryFlags;
|
|
25
|
-
readonly path: FilePath;
|
|
26
|
-
}
|
|
27
|
-
interface IndexExtension {
|
|
28
|
-
readonly signature: string;
|
|
29
|
-
readonly data: Uint8Array;
|
|
30
|
-
}
|
|
31
|
-
interface GitIndex {
|
|
32
|
-
readonly version: 2 | 3;
|
|
33
|
-
readonly entries: ReadonlyArray<IndexEntry>;
|
|
34
|
-
readonly extensions: ReadonlyArray<IndexExtension>;
|
|
35
|
-
}
|
|
1
|
+
import { b as Context, O as ObjectId, c as FilePath, j as RefName, g as HookName } from './context-CCL0_F8R.js';
|
|
2
|
+
import { d as CatFileBatchOptions, C as CatFileBatchEntry, e as CreateCommitInput, D as DiffTreesInput, f as DiffTreesOptions, T as TreeDiff, s as ReadObjectOptions, B as Blob, G as GitObject, a as Tree, t as ResolveRefOptions, F as FileMode, U as UpdateRefOptions, W as WalkCommitsOptions, E as Commit, v as WalkSubmodulesOptions, S as SubmoduleEntry, x as WalkTreeOptions, w as WalkTreeEntry, z as WalkWorkingTreeOptions, y as WalkWorkingTreeEntry, H as TreeEntry } from './reflog-entry-CSzjnZd4.js';
|
|
3
|
+
import { G as GitIndex, a as IndexEntryFlags, I as IndexEntry } from './index-entry-UD4dvtKh.js';
|
|
36
4
|
|
|
37
5
|
declare function catFileBatch(ctx: Context, ids: AsyncIterable<ObjectId> | Iterable<ObjectId>, options?: CatFileBatchOptions): AsyncIterable<CatFileBatchEntry>;
|
|
38
6
|
|
|
@@ -40,18 +8,46 @@ declare function createCommit(ctx: Context, input: CreateCommitInput): Promise<O
|
|
|
40
8
|
|
|
41
9
|
declare function diffTrees(ctx: Context, a: DiffTreesInput, b: DiffTreesInput, options?: DiffTreesOptions): Promise<TreeDiff>;
|
|
42
10
|
|
|
11
|
+
interface HashBlobOptions {
|
|
12
|
+
/** Persist the loose object under `.git/objects/<2>/<38>`. Default `false`. */
|
|
13
|
+
readonly write?: boolean;
|
|
14
|
+
}
|
|
15
|
+
declare const hashBlob: (ctx: Context, content: Uint8Array, opts?: HashBlobOptions) => Promise<ObjectId>;
|
|
16
|
+
|
|
17
|
+
interface IsIgnoredQuery {
|
|
18
|
+
readonly path: FilePath;
|
|
19
|
+
/** Match directory rules (`build/`). Defaults to `false`. */
|
|
20
|
+
readonly isDirectory?: boolean;
|
|
21
|
+
}
|
|
22
|
+
interface IsIgnoredMatchSource {
|
|
23
|
+
readonly kind: 'global' | 'info' | 'gitignore';
|
|
24
|
+
/** POSIX-relative directory whose file carried the rule. `''` for global / info / repo-root gitignore. */
|
|
25
|
+
readonly basedir: FilePath | '';
|
|
26
|
+
/** 1-based line number of the matching rule inside its file. */
|
|
27
|
+
readonly line: number;
|
|
28
|
+
/** Raw pattern text (e.g. `*.log`, `!keep.log`, `build/`). */
|
|
29
|
+
readonly pattern: string;
|
|
30
|
+
}
|
|
31
|
+
interface IsIgnoredMatch {
|
|
32
|
+
readonly path: FilePath;
|
|
33
|
+
readonly ignored: boolean;
|
|
34
|
+
/** Set only when `ignored === true`. */
|
|
35
|
+
readonly source?: IsIgnoredMatchSource;
|
|
36
|
+
}
|
|
37
|
+
declare const isIgnored: (ctx: Context, queries: ReadonlyArray<IsIgnoredQuery>) => Promise<ReadonlyArray<IsIgnoredMatch>>;
|
|
38
|
+
|
|
39
|
+
interface MergeBaseOptions {
|
|
40
|
+
readonly all?: boolean;
|
|
41
|
+
readonly octopus?: boolean;
|
|
42
|
+
}
|
|
43
43
|
/**
|
|
44
|
-
* Compute
|
|
45
|
-
*
|
|
46
|
-
* Algorithm: bidirectional BFS with two visited sets. After each layer
|
|
47
|
-
* advance, check the intersection. When non-empty, return the
|
|
48
|
-
* lexicographically smallest oid (deterministic tie-breaker).
|
|
44
|
+
* Compute merge bases — the best common ancestors of the given commits.
|
|
49
45
|
*
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
*
|
|
46
|
+
* `commits[0]` is `one`, the rest are the others. Returns the lexicographically
|
|
47
|
+
* smallest single base by default; the full reduced set with `{ all: true }`;
|
|
48
|
+
* the octopus fold with `{ octopus: true }`. Unrelated histories yield `[]`.
|
|
53
49
|
*/
|
|
54
|
-
declare const mergeBase: (ctx: Context,
|
|
50
|
+
declare const mergeBase: (ctx: Context, commits: readonly ObjectId[], options?: MergeBaseOptions) => Promise<readonly ObjectId[]>;
|
|
55
51
|
|
|
56
52
|
/**
|
|
57
53
|
* Pure path helpers composing `ctx.layout.gitDir` with known sub-paths.
|
|
@@ -102,6 +98,42 @@ interface HookInput {
|
|
|
102
98
|
*/
|
|
103
99
|
declare const runHook: (ctx: Context, name: HookName, input?: HookInput) => Promise<void>;
|
|
104
100
|
|
|
101
|
+
/**
|
|
102
|
+
* Flip flags (`assumeValid`, `skipWorktree`, `intentToAdd`) on an existing
|
|
103
|
+
* index entry without rehashing. Used by `stash pop`, `mv`, and other
|
|
104
|
+
* porcelain that need to restore flag state after a tree-level operation.
|
|
105
|
+
*
|
|
106
|
+
* The on-disk version is auto-promoted to v3 by `serializeIndex` whenever
|
|
107
|
+
* an extended flag flips true — nothing to manage at the primitive layer
|
|
108
|
+
* (ADR-164).
|
|
109
|
+
*/
|
|
110
|
+
|
|
111
|
+
interface SetEntryFlagsOptions {
|
|
112
|
+
readonly breakStaleLockMs?: number;
|
|
113
|
+
}
|
|
114
|
+
declare const setEntryFlags: (ctx: Context, path: FilePath, flags: Partial<IndexEntryFlags>, opts?: SetEntryFlagsOptions) => Promise<IndexEntry>;
|
|
115
|
+
|
|
116
|
+
type StageEntrySource = {
|
|
117
|
+
readonly content: Uint8Array;
|
|
118
|
+
readonly mode?: FileMode;
|
|
119
|
+
} | {
|
|
120
|
+
readonly id: ObjectId;
|
|
121
|
+
readonly mode: FileMode;
|
|
122
|
+
};
|
|
123
|
+
interface StageEntryOptions {
|
|
124
|
+
readonly breakStaleLockMs?: number;
|
|
125
|
+
/** Flags overlay on top of `STAGE0_FLAGS`. Use to seed `intentToAdd` etc. */
|
|
126
|
+
readonly flags?: Partial<IndexEntryFlags>;
|
|
127
|
+
}
|
|
128
|
+
declare const stageEntry: (ctx: Context, path: FilePath, source: StageEntrySource, opts?: StageEntryOptions) => Promise<IndexEntry>;
|
|
129
|
+
|
|
130
|
+
interface UnstageEntryOptions {
|
|
131
|
+
readonly breakStaleLockMs?: number;
|
|
132
|
+
}
|
|
133
|
+
declare const unstageEntry: (ctx: Context, path: FilePath, opts?: UnstageEntryOptions) => Promise<{
|
|
134
|
+
readonly removed: boolean;
|
|
135
|
+
}>;
|
|
136
|
+
|
|
105
137
|
declare function updateRef(ctx: Context, name: RefName, newId: ObjectId, options: UpdateRefOptions): Promise<void>;
|
|
106
138
|
|
|
107
139
|
declare function walkCommits(ctx: Context, options: WalkCommitsOptions): AsyncIterable<Commit>;
|
|
@@ -160,5 +192,5 @@ declare const writeSymbolicRef: (ctx: Context, name: RefName, target: RefName) =
|
|
|
160
192
|
|
|
161
193
|
declare function writeTree(ctx: Context, entries: ReadonlyArray<TreeEntry>): Promise<ObjectId>;
|
|
162
194
|
|
|
163
|
-
export { createCommit as a, readIndex as b, catFileBatch as c, diffTrees as d, readObject as e, readTree as f, getRepoRoot as g,
|
|
164
|
-
export type {
|
|
195
|
+
export { sparseCheckoutPath as E, createCommit as a, readIndex as b, catFileBatch as c, diffTrees as d, readObject as e, readTree as f, getRepoRoot as g, hashBlob as h, isIgnored as i, recordRefUpdate as j, resolveRef as k, runHook as l, mergeBase as m, stageEntry as n, updateRef as o, walkSubmodules as p, walkTree as q, readBlob as r, setEntryFlags as s, walkWorkingTree as t, unstageEntry as u, writeObject as v, walkCommits as w, writeSymbolicRef as x, writeTree as y };
|
|
196
|
+
export type { IsIgnoredMatchSource as A, IsIgnoredQuery as B, StageEntryOptions as C, StageEntrySource as D, HashBlobOptions as H, IsIgnoredMatch as I, SetEntryFlagsOptions as S, UnstageEntryOptions as U, HookInput as z };
|