@statewalker/vcs-commands 0.3.2 → 0.5.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.
- package/README.md +19 -0
- package/dist/commands/add-command.d.ts +0 -6
- package/dist/commands/add-command.d.ts.map +1 -1
- package/dist/commands/blame-command.d.ts +14 -0
- package/dist/commands/blame-command.d.ts.map +1 -1
- package/dist/commands/branch-command.d.ts.map +1 -1
- package/dist/commands/checkout-command.d.ts +7 -24
- package/dist/commands/checkout-command.d.ts.map +1 -1
- package/dist/commands/clean-command.d.ts +34 -4
- package/dist/commands/clean-command.d.ts.map +1 -1
- package/dist/commands/clone-command.d.ts +61 -21
- package/dist/commands/clone-command.d.ts.map +1 -1
- package/dist/commands/core-config.d.ts +16 -0
- package/dist/commands/core-config.d.ts.map +1 -0
- package/dist/commands/fetch-command.d.ts +104 -37
- package/dist/commands/fetch-command.d.ts.map +1 -1
- package/dist/commands/index.d.ts +1 -0
- package/dist/commands/index.d.ts.map +1 -1
- package/dist/commands/index.js +2 -2
- package/dist/commands/init-command.d.ts.map +1 -1
- package/dist/commands/merge-command.d.ts +15 -2
- package/dist/commands/merge-command.d.ts.map +1 -1
- package/dist/commands/push-command.d.ts +58 -25
- package/dist/commands/push-command.d.ts.map +1 -1
- package/dist/commands/remote-command.d.ts +115 -6
- package/dist/commands/remote-command.d.ts.map +1 -1
- package/dist/commands/reset-command.d.ts.map +1 -1
- package/dist/commands/stash-apply-command.d.ts +35 -13
- package/dist/commands/stash-apply-command.d.ts.map +1 -1
- package/dist/commands/stash-create-command.d.ts +59 -25
- package/dist/commands/stash-create-command.d.ts.map +1 -1
- package/dist/commands/stash-drop-command.d.ts +8 -2
- package/dist/commands/stash-drop-command.d.ts.map +1 -1
- package/dist/commands/stash-list-command.d.ts +2 -4
- package/dist/commands/stash-list-command.d.ts.map +1 -1
- package/dist/commands/stash-working-tree.d.ts +72 -0
- package/dist/commands/stash-working-tree.d.ts.map +1 -0
- package/dist/commands/status-command.d.ts +29 -22
- package/dist/commands/status-command.d.ts.map +1 -1
- package/dist/commands/tag-command.d.ts.map +1 -1
- package/dist/commands/tree-restore.d.ts +52 -5
- package/dist/commands/tree-restore.d.ts.map +1 -1
- package/dist/commands/worktree-overwrite-checks.d.ts +64 -0
- package/dist/commands/worktree-overwrite-checks.d.ts.map +1 -0
- package/dist/{commands-COO4tJhv.js → commands-CsLNyvZ1.js} +3370 -1057
- package/dist/core-commands/add.command.impl.d.ts +0 -4
- package/dist/core-commands/add.command.impl.d.ts.map +1 -1
- package/dist/core-commands/index.d.ts +1 -3
- package/dist/core-commands/index.d.ts.map +1 -1
- package/dist/core-commands/store-worktree-file.d.ts +6 -0
- package/dist/core-commands/store-worktree-file.d.ts.map +1 -0
- package/dist/errors/checkout-errors.d.ts +13 -0
- package/dist/errors/checkout-errors.d.ts.map +1 -1
- package/dist/errors/index.js +18 -1
- package/dist/git-command.d.ts +10 -1
- package/dist/git-command.d.ts.map +1 -1
- package/dist/git.d.ts +21 -3
- package/dist/git.d.ts.map +1 -1
- package/dist/index.js +4 -4
- package/dist/remote-config/index.d.ts +1 -0
- package/dist/remote-config/index.d.ts.map +1 -1
- package/dist/remote-config/remote-config-store.d.ts +22 -0
- package/dist/remote-config/remote-config-store.d.ts.map +1 -1
- package/dist/remote-config/remote-refs.d.ts +37 -0
- package/dist/remote-config/remote-refs.d.ts.map +1 -0
- package/dist/results/clone-result.d.ts +6 -0
- package/dist/results/clone-result.d.ts.map +1 -1
- package/dist/results/diff-formatter.d.ts +14 -7
- package/dist/results/diff-formatter.d.ts.map +1 -1
- package/dist/results/fetch-result.d.ts +16 -1
- package/dist/results/fetch-result.d.ts.map +1 -1
- package/dist/results/index.js +28 -23
- package/dist/results/push-result.d.ts +9 -2
- package/dist/results/push-result.d.ts.map +1 -1
- package/dist/results/status-result.d.ts +91 -20
- package/dist/results/status-result.d.ts.map +1 -1
- package/dist/{status-result-BwAyxq6R.js → status-result-BpyUK1Sg.js} +115 -5
- package/dist/transport-command.d.ts +12 -0
- package/dist/transport-command.d.ts.map +1 -1
- package/package.json +14 -12
- package/src/commands/add-command.ts +23 -30
- package/src/commands/blame-command.ts +41 -0
- package/src/commands/branch-command.ts +2 -53
- package/src/commands/checkout-command.ts +205 -127
- package/src/commands/clean-command.ts +187 -81
- package/src/commands/clone-command.ts +334 -137
- package/src/commands/core-config.ts +41 -0
- package/src/commands/fetch-command.ts +536 -211
- package/src/commands/gc-command.ts +1 -1
- package/src/commands/index.ts +1 -0
- package/src/commands/init-command.ts +108 -11
- package/src/commands/merge-command.ts +60 -27
- package/src/commands/pack-refs-command.ts +2 -2
- package/src/commands/push-command.ts +242 -308
- package/src/commands/reflog-command.ts +2 -2
- package/src/commands/remote-command.ts +429 -19
- package/src/commands/reset-command.ts +18 -5
- package/src/commands/stash-apply-command.ts +632 -97
- package/src/commands/stash-create-command.ts +142 -62
- package/src/commands/stash-drop-command.ts +53 -5
- package/src/commands/stash-list-command.ts +10 -4
- package/src/commands/stash-working-tree.ts +243 -0
- package/src/commands/status-command.ts +197 -91
- package/src/commands/tag-command.ts +2 -53
- package/src/commands/tree-restore.ts +143 -18
- package/src/commands/worktree-overwrite-checks.ts +215 -0
- package/src/core-commands/add.command.impl.ts +15 -20
- package/src/core-commands/index.ts +1 -8
- package/src/core-commands/store-worktree-file.ts +5 -0
- package/src/errors/checkout-errors.ts +20 -0
- package/src/git-command.ts +42 -1
- package/src/git.ts +30 -2
- package/src/remote-config/index.ts +1 -0
- package/src/remote-config/remote-config-store.ts +95 -8
- package/src/remote-config/remote-refs.ts +103 -0
- package/src/results/clone-result.ts +6 -0
- package/src/results/diff-formatter.ts +31 -38
- package/src/results/fetch-result.ts +16 -1
- package/src/results/push-result.ts +9 -2
- package/src/results/status-result.ts +212 -29
- package/src/transport-command.ts +18 -0
- package/dist/core-commands/checkout.command.d.ts +0 -103
- package/dist/core-commands/checkout.command.d.ts.map +0 -1
- package/dist/core-commands/checkout.command.impl.d.ts +0 -114
- package/dist/core-commands/checkout.command.impl.d.ts.map +0 -1
- package/dist/pack-import/index.d.ts +0 -8
- package/dist/pack-import/index.d.ts.map +0 -1
- package/dist/pack-import/pack-import.d.ts +0 -11
- package/dist/pack-import/pack-import.d.ts.map +0 -1
- package/src/core-commands/checkout.command.impl.ts +0 -586
- package/src/core-commands/checkout.command.ts +0 -125
- package/src/pack-import/index.ts +0 -8
- package/src/pack-import/pack-import.ts +0 -24
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import type { History, HistoryWithOperations } from "@statewalker/vcs-core";
|
|
2
|
-
// Import from the package root only: vcs-core ships a single runtime file
|
|
3
|
-
// (dist/index.js); its subpaths resolve for types but not at runtime.
|
|
4
|
-
import { DefaultSerializationApi } from "@statewalker/vcs-core";
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Unpack pack data into a history's object stores.
|
|
8
|
-
*
|
|
9
|
-
* Uses the history's own {@link SerializationApi} when it exposes one
|
|
10
|
-
* (a `HistoryWithOperations`), otherwise builds a default one over its
|
|
11
|
-
* object stores — `WorkingCopy.history` is typed as a plain `History`,
|
|
12
|
-
* so `serialization` is not statically available.
|
|
13
|
-
*/
|
|
14
|
-
export async function importPackIntoHistory(history: History, packData: Uint8Array): Promise<void> {
|
|
15
|
-
const serialization =
|
|
16
|
-
(history as Partial<HistoryWithOperations>).serialization ??
|
|
17
|
-
new DefaultSerializationApi({ history });
|
|
18
|
-
|
|
19
|
-
const packStream = (async function* () {
|
|
20
|
-
yield packData;
|
|
21
|
-
})();
|
|
22
|
-
|
|
23
|
-
await serialization.importPack(packStream);
|
|
24
|
-
}
|