@statewalker/vcs-commands 0.8.0 → 0.10.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 +1 -1
- package/dist/commands/add-command.d.ts +32 -0
- package/dist/commands/add-command.d.ts.map +1 -1
- package/dist/commands/add-patch/add-patch.d.ts +7 -0
- package/dist/commands/add-patch/add-patch.d.ts.map +1 -1
- package/dist/commands/add-patch/patch-backend.d.ts +2 -0
- package/dist/commands/add-patch/patch-backend.d.ts.map +1 -1
- package/dist/commands/add-patch/patch-modes.d.ts +6 -2
- package/dist/commands/add-patch/patch-modes.d.ts.map +1 -1
- package/dist/commands/add-patch/patch-session.d.ts +4 -0
- package/dist/commands/add-patch/patch-session.d.ts.map +1 -1
- package/dist/commands/am/am-command.d.ts +88 -2
- package/dist/commands/am/am-command.d.ts.map +1 -1
- package/dist/commands/apply/apply-command.d.ts +2 -0
- package/dist/commands/apply/apply-command.d.ts.map +1 -1
- package/dist/commands/apply/apply-parse.d.ts +7 -0
- package/dist/commands/apply/apply-parse.d.ts.map +1 -1
- package/dist/commands/apply/index.d.ts +1 -1
- package/dist/commands/apply/index.d.ts.map +1 -1
- package/dist/commands/archive/archive-command.d.ts +169 -0
- package/dist/commands/archive/archive-command.d.ts.map +1 -0
- package/dist/commands/archive/archive-entry.d.ts +60 -0
- package/dist/commands/archive/archive-entry.d.ts.map +1 -0
- package/dist/commands/archive/index.d.ts +8 -0
- package/dist/commands/archive/index.d.ts.map +1 -0
- package/dist/commands/archive/remote-archive-command.d.ts +56 -0
- package/dist/commands/archive/remote-archive-command.d.ts.map +1 -0
- package/dist/commands/archive/tar-archive.d.ts +31 -0
- package/dist/commands/archive/tar-archive.d.ts.map +1 -0
- package/dist/commands/archive/tar-commit-id.d.ts +13 -0
- package/dist/commands/archive/tar-commit-id.d.ts.map +1 -0
- package/dist/commands/archive/upload-archive-writer.d.ts +48 -0
- package/dist/commands/archive/upload-archive-writer.d.ts.map +1 -0
- package/dist/commands/archive/zip-archive.d.ts +42 -0
- package/dist/commands/archive/zip-archive.d.ts.map +1 -0
- package/dist/commands/attributes-source.d.ts +10 -0
- package/dist/commands/attributes-source.d.ts.map +1 -1
- package/dist/commands/blame-command.d.ts +345 -8
- package/dist/commands/blame-command.d.ts.map +1 -1
- package/dist/commands/blame-ignore.d.ts +48 -0
- package/dist/commands/blame-ignore.d.ts.map +1 -0
- package/dist/commands/bundle/bundle-create-command.d.ts +67 -0
- package/dist/commands/bundle/bundle-create-command.d.ts.map +1 -0
- package/dist/commands/bundle/bundle-format.d.ts +89 -0
- package/dist/commands/bundle/bundle-format.d.ts.map +1 -0
- package/dist/commands/bundle/bundle-list.d.ts +92 -0
- package/dist/commands/bundle/bundle-list.d.ts.map +1 -0
- package/dist/commands/bundle/bundle-read-commands.d.ts +81 -0
- package/dist/commands/bundle/bundle-read-commands.d.ts.map +1 -0
- package/dist/commands/bundle/bundle-support.d.ts +32 -0
- package/dist/commands/bundle/bundle-support.d.ts.map +1 -0
- package/dist/commands/bundle/bundle-transport.d.ts +38 -0
- package/dist/commands/bundle/bundle-transport.d.ts.map +1 -0
- package/dist/commands/bundle/bundle-uri-host.d.ts +43 -0
- package/dist/commands/bundle/bundle-uri-host.d.ts.map +1 -0
- package/dist/commands/bundle/bundle-uri.d.ts +55 -0
- package/dist/commands/bundle/bundle-uri.d.ts.map +1 -0
- package/dist/commands/bundle/bundle-verify.d.ts +63 -0
- package/dist/commands/bundle/bundle-verify.d.ts.map +1 -0
- package/dist/commands/bundle/index.d.ts +14 -0
- package/dist/commands/bundle/index.d.ts.map +1 -0
- package/dist/commands/cat-file/batch-format.d.ts +58 -0
- package/dist/commands/cat-file/batch-format.d.ts.map +1 -0
- package/dist/commands/cat-file/cat-file-command.d.ts +135 -0
- package/dist/commands/cat-file/cat-file-command.d.ts.map +1 -0
- package/dist/commands/cat-file/index.d.ts +3 -0
- package/dist/commands/cat-file/index.d.ts.map +1 -0
- package/dist/commands/check-attr-command.d.ts +66 -0
- package/dist/commands/check-attr-command.d.ts.map +1 -0
- package/dist/commands/check-ignore-command.d.ts +58 -0
- package/dist/commands/check-ignore-command.d.ts.map +1 -0
- package/dist/commands/check-mailmap-command.d.ts +49 -0
- package/dist/commands/check-mailmap-command.d.ts.map +1 -0
- package/dist/commands/check-ref-format-command.d.ts +60 -0
- package/dist/commands/check-ref-format-command.d.ts.map +1 -0
- package/dist/commands/checkout-command.d.ts +7 -0
- package/dist/commands/checkout-command.d.ts.map +1 -1
- package/dist/commands/checkout-index-command.d.ts +96 -0
- package/dist/commands/checkout-index-command.d.ts.map +1 -0
- package/dist/commands/checkout-paths.d.ts +4 -0
- package/dist/commands/checkout-paths.d.ts.map +1 -1
- package/dist/commands/cherry-command.d.ts +61 -0
- package/dist/commands/cherry-command.d.ts.map +1 -0
- package/dist/commands/cherry-pick-command.d.ts +33 -1
- package/dist/commands/cherry-pick-command.d.ts.map +1 -1
- package/dist/commands/clean-command.d.ts +32 -0
- package/dist/commands/clean-command.d.ts.map +1 -1
- package/dist/commands/clean-interactive.d.ts +56 -0
- package/dist/commands/clean-interactive.d.ts.map +1 -0
- package/dist/commands/clone-command.d.ts +135 -2
- package/dist/commands/clone-command.d.ts.map +1 -1
- package/dist/commands/commit-command.d.ts +59 -3
- package/dist/commands/commit-command.d.ts.map +1 -1
- package/dist/commands/config-command.d.ts +2 -0
- package/dist/commands/config-command.d.ts.map +1 -1
- package/dist/commands/daemon-access-hook.d.ts +36 -0
- package/dist/commands/daemon-access-hook.d.ts.map +1 -0
- package/dist/commands/default-branch.d.ts +42 -0
- package/dist/commands/default-branch.d.ts.map +1 -1
- package/dist/commands/describe-command.d.ts +71 -64
- package/dist/commands/describe-command.d.ts.map +1 -1
- package/dist/commands/diff-command.d.ts +249 -10
- package/dist/commands/diff-command.d.ts.map +1 -1
- package/dist/commands/diff-external.d.ts +43 -0
- package/dist/commands/diff-external.d.ts.map +1 -0
- package/dist/commands/diff-plumbing/diff-pairs-command.d.ts +27 -0
- package/dist/commands/diff-plumbing/diff-pairs-command.d.ts.map +1 -0
- package/dist/commands/diff-plumbing/diff-plumbing-command.d.ts +129 -0
- package/dist/commands/diff-plumbing/diff-plumbing-command.d.ts.map +1 -0
- package/dist/commands/diff-plumbing/index.d.ts +3 -0
- package/dist/commands/diff-plumbing/index.d.ts.map +1 -0
- package/dist/commands/diff-textconv.d.ts +5 -1
- package/dist/commands/diff-textconv.d.ts.map +1 -1
- package/dist/commands/fast-export/fast-export-command.d.ts +135 -0
- package/dist/commands/fast-export/fast-export-command.d.ts.map +1 -0
- package/dist/commands/fast-export/fast-import-command.d.ts +182 -0
- package/dist/commands/fast-export/fast-import-command.d.ts.map +1 -0
- package/dist/commands/fast-export/fast-stream-support.d.ts +64 -0
- package/dist/commands/fast-export/fast-stream-support.d.ts.map +1 -0
- package/dist/commands/fast-export/index.d.ts +4 -0
- package/dist/commands/fast-export/index.d.ts.map +1 -0
- package/dist/commands/fetch-command.d.ts +125 -0
- package/dist/commands/fetch-command.d.ts.map +1 -1
- package/dist/commands/fetch-multiple-command.d.ts +193 -0
- package/dist/commands/fetch-multiple-command.d.ts.map +1 -0
- package/dist/commands/format-patch-command.d.ts +28 -2
- package/dist/commands/format-patch-command.d.ts.map +1 -1
- package/dist/commands/format-rev-command.d.ts +58 -0
- package/dist/commands/format-rev-command.d.ts.map +1 -0
- package/dist/commands/fsck/fsck-command.d.ts.map +1 -1
- package/dist/commands/fsck/fsck-msg-ids.d.ts +18 -3
- package/dist/commands/fsck/fsck-msg-ids.d.ts.map +1 -1
- package/dist/commands/fsmonitor-refresh.d.ts +69 -0
- package/dist/commands/fsmonitor-refresh.d.ts.map +1 -0
- package/dist/commands/gc-command.d.ts +5 -0
- package/dist/commands/gc-command.d.ts.map +1 -1
- package/dist/commands/git-describe.d.ts +77 -4
- package/dist/commands/git-describe.d.ts.map +1 -1
- package/dist/commands/git-hooks.d.ts +47 -1
- package/dist/commands/git-hooks.d.ts.map +1 -1
- package/dist/commands/git-paths.d.ts +26 -0
- package/dist/commands/git-paths.d.ts.map +1 -0
- package/dist/commands/grep/grep-command.d.ts +2 -1
- package/dist/commands/grep/grep-command.d.ts.map +1 -1
- package/dist/commands/history-command.d.ts +156 -0
- package/dist/commands/history-command.d.ts.map +1 -0
- package/dist/commands/http-config.d.ts +38 -0
- package/dist/commands/http-config.d.ts.map +1 -0
- package/dist/commands/index-adder.d.ts +12 -1
- package/dist/commands/index-adder.d.ts.map +1 -1
- package/dist/commands/index-host.d.ts.map +1 -1
- package/dist/commands/index.d.ts +56 -1
- package/dist/commands/index.d.ts.map +1 -1
- package/dist/commands/index.js +6 -3
- package/dist/commands/init-command.d.ts +89 -0
- package/dist/commands/init-command.d.ts.map +1 -1
- package/dist/commands/last-modified-command.d.ts +102 -0
- package/dist/commands/last-modified-command.d.ts.map +1 -0
- package/dist/commands/lfs/go-url.d.ts +43 -0
- package/dist/commands/lfs/go-url.d.ts.map +1 -0
- package/dist/commands/lfs/index.d.ts +3 -0
- package/dist/commands/lfs/index.d.ts.map +1 -0
- package/dist/commands/lfs/lfs-config.d.ts +174 -0
- package/dist/commands/lfs/lfs-config.d.ts.map +1 -0
- package/dist/commands/lfs/lfs-endpoint-command.d.ts +83 -0
- package/dist/commands/lfs/lfs-endpoint-command.d.ts.map +1 -0
- package/dist/commands/line-log.d.ts +161 -0
- package/dist/commands/line-log.d.ts.map +1 -0
- package/dist/commands/local-transport.d.ts.map +1 -1
- package/dist/commands/log-command.d.ts +261 -6
- package/dist/commands/log-command.d.ts.map +1 -1
- package/dist/commands/log-graph.d.ts +4 -2
- package/dist/commands/log-graph.d.ts.map +1 -1
- package/dist/commands/log-output.d.ts +88 -2
- package/dist/commands/log-output.d.ts.map +1 -1
- package/dist/commands/ls-files-command.d.ts +153 -0
- package/dist/commands/ls-files-command.d.ts.map +1 -0
- package/dist/commands/ls-remote-command.d.ts +5 -0
- package/dist/commands/ls-remote-command.d.ts.map +1 -1
- package/dist/commands/ls-tree-command.d.ts +105 -0
- package/dist/commands/ls-tree-command.d.ts.map +1 -0
- package/dist/commands/mailmap.d.ts +24 -1
- package/dist/commands/mailmap.d.ts.map +1 -1
- package/dist/commands/maintenance-run-command.d.ts +122 -0
- package/dist/commands/maintenance-run-command.d.ts.map +1 -0
- package/dist/commands/merge-command.d.ts +58 -1
- package/dist/commands/merge-command.d.ts.map +1 -1
- package/dist/commands/merge-config.d.ts +7 -0
- package/dist/commands/merge-config.d.ts.map +1 -1
- package/dist/commands/merge-drivers.d.ts +69 -5
- package/dist/commands/merge-drivers.d.ts.map +1 -1
- package/dist/commands/merge-strategy-options.d.ts +69 -0
- package/dist/commands/merge-strategy-options.d.ts.map +1 -0
- package/dist/commands/merge-support.d.ts +16 -0
- package/dist/commands/merge-support.d.ts.map +1 -1
- package/dist/commands/merge-tree-command.d.ts +122 -0
- package/dist/commands/merge-tree-command.d.ts.map +1 -0
- package/dist/commands/message-cleanup.d.ts +2 -0
- package/dist/commands/message-cleanup.d.ts.map +1 -1
- package/dist/commands/mktag-command.d.ts +51 -0
- package/dist/commands/mktag-command.d.ts.map +1 -0
- package/dist/commands/name-rev-command.d.ts +65 -0
- package/dist/commands/name-rev-command.d.ts.map +1 -0
- package/dist/commands/name-rev.d.ts +110 -22
- package/dist/commands/name-rev.d.ts.map +1 -1
- package/dist/commands/object-store/count-objects-command.d.ts +58 -0
- package/dist/commands/object-store/count-objects-command.d.ts.map +1 -0
- package/dist/commands/object-store/index.d.ts +5 -0
- package/dist/commands/object-store/index.d.ts.map +1 -0
- package/dist/commands/object-store/objects-directory.d.ts +12 -0
- package/dist/commands/object-store/objects-directory.d.ts.map +1 -0
- package/dist/commands/object-store/prune-command.d.ts +38 -0
- package/dist/commands/object-store/prune-command.d.ts.map +1 -0
- package/dist/commands/object-store/show-index-command.d.ts +23 -0
- package/dist/commands/object-store/show-index-command.d.ts.map +1 -0
- package/dist/commands/octopus-merge.d.ts +26 -1
- package/dist/commands/octopus-merge.d.ts.map +1 -1
- package/dist/commands/ort-merge.d.ts +40 -0
- package/dist/commands/ort-merge.d.ts.map +1 -1
- package/dist/commands/ort-recursive.d.ts.map +1 -1
- package/dist/commands/patch-id-command.d.ts +30 -0
- package/dist/commands/patch-id-command.d.ts.map +1 -0
- package/dist/commands/patch-id.d.ts +82 -0
- package/dist/commands/patch-id.d.ts.map +1 -1
- package/dist/commands/plumbing-command.d.ts +66 -0
- package/dist/commands/plumbing-command.d.ts.map +1 -0
- package/dist/commands/plumbing-input.d.ts +38 -0
- package/dist/commands/plumbing-input.d.ts.map +1 -0
- package/dist/commands/promisor-remote-reply.d.ts +35 -0
- package/dist/commands/promisor-remote-reply.d.ts.map +1 -0
- package/dist/commands/promisor-remote.d.ts.map +1 -1
- package/dist/commands/pull-command.d.ts +182 -38
- package/dist/commands/pull-command.d.ts.map +1 -1
- package/dist/commands/push-command.d.ts +82 -2
- package/dist/commands/push-command.d.ts.map +1 -1
- package/dist/commands/range-diff/index.d.ts +4 -0
- package/dist/commands/range-diff/index.d.ts.map +1 -0
- package/dist/commands/range-diff/linear-assignment.d.ts +27 -0
- package/dist/commands/range-diff/linear-assignment.d.ts.map +1 -0
- package/dist/commands/range-diff/range-diff-command.d.ts +121 -0
- package/dist/commands/range-diff/range-diff-command.d.ts.map +1 -0
- package/dist/commands/range-diff/range-diff.d.ts +106 -0
- package/dist/commands/range-diff/range-diff.d.ts.map +1 -0
- package/dist/commands/read-tree-command.d.ts +14 -0
- package/dist/commands/read-tree-command.d.ts.map +1 -1
- package/dist/commands/rebase-command.d.ts +129 -4
- package/dist/commands/rebase-command.d.ts.map +1 -1
- package/dist/commands/refs-command.d.ts +81 -0
- package/dist/commands/refs-command.d.ts.map +1 -0
- package/dist/commands/remerge-diff.d.ts +59 -0
- package/dist/commands/remerge-diff.d.ts.map +1 -0
- package/dist/commands/remote-command.d.ts +41 -0
- package/dist/commands/remote-command.d.ts.map +1 -1
- package/dist/commands/remote-object-info-command.d.ts +55 -0
- package/dist/commands/remote-object-info-command.d.ts.map +1 -0
- package/dist/commands/remote-show-command.d.ts +204 -0
- package/dist/commands/remote-show-command.d.ts.map +1 -0
- package/dist/commands/remote-transport.d.ts +40 -3
- package/dist/commands/remote-transport.d.ts.map +1 -1
- package/dist/commands/repack-command.d.ts +115 -0
- package/dist/commands/repack-command.d.ts.map +1 -0
- package/dist/commands/replace-command.d.ts +143 -0
- package/dist/commands/replace-command.d.ts.map +1 -0
- package/dist/commands/replay-command.d.ts +117 -0
- package/dist/commands/replay-command.d.ts.map +1 -0
- package/dist/commands/repo-command.d.ts +136 -0
- package/dist/commands/repo-command.d.ts.map +1 -0
- package/dist/commands/request-pull-command.d.ts +82 -0
- package/dist/commands/request-pull-command.d.ts.map +1 -0
- package/dist/commands/rerere-command.d.ts +36 -0
- package/dist/commands/rerere-command.d.ts.map +1 -0
- package/dist/commands/rerere.d.ts +102 -0
- package/dist/commands/rerere.d.ts.map +1 -0
- package/dist/commands/reset-command.d.ts +19 -1
- package/dist/commands/reset-command.d.ts.map +1 -1
- package/dist/commands/restore-command.d.ts +7 -0
- package/dist/commands/restore-command.d.ts.map +1 -1
- package/dist/commands/rev-filter/commit-grep.d.ts +3 -1
- package/dist/commands/rev-filter/commit-grep.d.ts.map +1 -1
- package/dist/commands/rev-list-command.d.ts +78 -3
- package/dist/commands/rev-list-command.d.ts.map +1 -1
- package/dist/commands/rev-parse-command.d.ts +9 -0
- package/dist/commands/rev-parse-command.d.ts.map +1 -1
- package/dist/commands/revert-command.d.ts +32 -1
- package/dist/commands/revert-command.d.ts.map +1 -1
- package/dist/commands/revision-range.d.ts +7 -0
- package/dist/commands/revision-range.d.ts.map +1 -1
- package/dist/commands/revision-resolver.d.ts +12 -0
- package/dist/commands/revision-resolver.d.ts.map +1 -1
- package/dist/commands/sequencer-pick.d.ts +120 -1
- package/dist/commands/sequencer-pick.d.ts.map +1 -1
- package/dist/commands/sequencer-support.d.ts +10 -1
- package/dist/commands/sequencer-support.d.ts.map +1 -1
- package/dist/commands/serve-repository.d.ts +23 -1
- package/dist/commands/serve-repository.d.ts.map +1 -1
- package/dist/commands/session-id.d.ts +18 -0
- package/dist/commands/session-id.d.ts.map +1 -0
- package/dist/commands/shortlog-command.d.ts +109 -0
- package/dist/commands/shortlog-command.d.ts.map +1 -0
- package/dist/commands/shortlog.d.ts +151 -0
- package/dist/commands/shortlog.d.ts.map +1 -0
- package/dist/commands/show-branch-command.d.ts +59 -0
- package/dist/commands/show-branch-command.d.ts.map +1 -0
- package/dist/commands/show-ref-command.d.ts +112 -0
- package/dist/commands/show-ref-command.d.ts.map +1 -0
- package/dist/commands/signature-check.d.ts +9 -2
- package/dist/commands/signature-check.d.ts.map +1 -1
- package/dist/commands/signing.d.ts +22 -1
- package/dist/commands/signing.d.ts.map +1 -1
- package/dist/commands/stash-apply-command.d.ts.map +1 -1
- package/dist/commands/stash-export-command.d.ts +115 -0
- package/dist/commands/stash-export-command.d.ts.map +1 -0
- package/dist/commands/status-command.d.ts +33 -3
- package/dist/commands/status-command.d.ts.map +1 -1
- package/dist/commands/stripspace-command.d.ts +44 -0
- package/dist/commands/stripspace-command.d.ts.map +1 -0
- package/dist/commands/submodule-add-command.d.ts +10 -1
- package/dist/commands/submodule-add-command.d.ts.map +1 -1
- package/dist/commands/submodule-auth.d.ts +3 -1
- package/dist/commands/submodule-auth.d.ts.map +1 -1
- package/dist/commands/submodule-commands.d.ts +99 -3
- package/dist/commands/submodule-commands.d.ts.map +1 -1
- package/dist/commands/submodule-fetch.d.ts +149 -0
- package/dist/commands/submodule-fetch.d.ts.map +1 -0
- package/dist/commands/submodule-model.d.ts +8 -0
- package/dist/commands/submodule-model.d.ts.map +1 -1
- package/dist/commands/submodule-unpack.d.ts +120 -0
- package/dist/commands/submodule-unpack.d.ts.map +1 -0
- package/dist/commands/submodule-update-command.d.ts +21 -1
- package/dist/commands/submodule-update-command.d.ts.map +1 -1
- package/dist/commands/subtree-shift.d.ts +27 -0
- package/dist/commands/subtree-shift.d.ts.map +1 -0
- package/dist/commands/switch-command.d.ts +3 -0
- package/dist/commands/switch-command.d.ts.map +1 -1
- package/dist/commands/textconv-cache.d.ts +58 -0
- package/dist/commands/textconv-cache.d.ts.map +1 -0
- package/dist/commands/tree-restore.d.ts +5 -0
- package/dist/commands/tree-restore.d.ts.map +1 -1
- package/dist/commands/unpack-objects-command.d.ts +47 -0
- package/dist/commands/unpack-objects-command.d.ts.map +1 -0
- package/dist/commands/update-index-command.d.ts +110 -0
- package/dist/commands/update-index-command.d.ts.map +1 -0
- package/dist/commands/uri-protocols.d.ts +13 -0
- package/dist/commands/uri-protocols.d.ts.map +1 -0
- package/dist/commands/url-parse-command.d.ts +30 -0
- package/dist/commands/url-parse-command.d.ts.map +1 -0
- package/dist/commands/var-command.d.ts +42 -0
- package/dist/commands/var-command.d.ts.map +1 -0
- package/dist/commands/worktree-overwrite-checks.d.ts +2 -0
- package/dist/commands/worktree-overwrite-checks.d.ts.map +1 -1
- package/dist/{commands-ISM52N0n.js → commands-Mlo1dxQN.js} +56133 -70269
- package/dist/errors/command-errors.d.ts +58 -0
- package/dist/errors/command-errors.d.ts.map +1 -1
- package/dist/errors/index.js +67 -1
- package/dist/fsck-CrhVMNIH.js +5179 -0
- package/dist/git-command.d.ts +89 -3
- package/dist/git-command.d.ts.map +1 -1
- package/dist/git.d.ts +628 -1
- package/dist/git.d.ts.map +1 -1
- package/dist/guarded-transport-command.d.ts +84 -0
- package/dist/guarded-transport-command.d.ts.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -5
- package/dist/maintenance-run-command-Bw21HEkH.js +13539 -0
- package/dist/remote-transport-Bu4PGSMD.js +2605 -0
- package/dist/rename/detect-renames.d.ts +20 -0
- package/dist/rename/detect-renames.d.ts.map +1 -1
- package/dist/rename/diffcore-break.d.ts +51 -0
- package/dist/rename/diffcore-break.d.ts.map +1 -0
- package/dist/rename/index.d.ts +1 -0
- package/dist/rename/index.d.ts.map +1 -1
- package/dist/results/blame-format.d.ts +62 -1
- package/dist/results/blame-format.d.ts.map +1 -1
- package/dist/results/cherry-pick-result.d.ts +6 -0
- package/dist/results/cherry-pick-result.d.ts.map +1 -1
- package/dist/results/clone-result.d.ts +9 -0
- package/dist/results/clone-result.d.ts.map +1 -1
- package/dist/results/diff-dirstat.d.ts +36 -0
- package/dist/results/diff-dirstat.d.ts.map +1 -0
- package/dist/results/diff-entry.d.ts +20 -0
- package/dist/results/diff-entry.d.ts.map +1 -1
- package/dist/results/diff-formatter.d.ts.map +1 -1
- package/dist/results/diff-output.d.ts +67 -3
- package/dist/results/diff-output.d.ts.map +1 -1
- package/dist/results/fetch-result.d.ts +24 -1
- package/dist/results/fetch-result.d.ts.map +1 -1
- package/dist/results/index.d.ts +2 -0
- package/dist/results/index.d.ts.map +1 -1
- package/dist/results/index.js +2 -2
- package/dist/results/init-result.d.ts +8 -1
- package/dist/results/init-result.d.ts.map +1 -1
- package/dist/results/line-range-hunks.d.ts +27 -0
- package/dist/results/line-range-hunks.d.ts.map +1 -0
- package/dist/results/merge-result.d.ts +13 -1
- package/dist/results/merge-result.d.ts.map +1 -1
- package/dist/results/pull-result.d.ts +11 -0
- package/dist/results/pull-result.d.ts.map +1 -1
- package/dist/results/push-result.d.ts +10 -0
- package/dist/results/push-result.d.ts.map +1 -1
- package/dist/results/rebase-result.d.ts +7 -0
- package/dist/results/rebase-result.d.ts.map +1 -1
- package/dist/results/revert-result.d.ts +6 -0
- package/dist/results/revert-result.d.ts.map +1 -1
- package/dist/results/stash-result.d.ts +5 -0
- package/dist/results/stash-result.d.ts.map +1 -1
- package/dist/results/status-result.d.ts +1 -1
- package/dist/results/status-result.d.ts.map +1 -1
- package/dist/results-ERo9vELd.js +49673 -0
- package/dist/transport-command.d.ts +93 -1
- package/dist/transport-command.d.ts.map +1 -1
- package/package.json +12 -12
- package/src/commands/add-command.ts +118 -0
- package/src/commands/add-patch/add-patch.ts +8 -0
- package/src/commands/add-patch/patch-backend.ts +24 -3
- package/src/commands/add-patch/patch-modes.ts +26 -2
- package/src/commands/add-patch/patch-session.ts +6 -0
- package/src/commands/am/am-command.ts +301 -12
- package/src/commands/apply/apply-command.ts +52 -9
- package/src/commands/apply/apply-parse.ts +10 -0
- package/src/commands/apply/index.ts +9 -1
- package/src/commands/archive/archive-command.ts +1148 -0
- package/src/commands/archive/archive-entry.ts +93 -0
- package/src/commands/archive/index.ts +7 -0
- package/src/commands/archive/remote-archive-command.ts +140 -0
- package/src/commands/archive/tar-archive.ts +207 -0
- package/src/commands/archive/tar-commit-id.ts +72 -0
- package/src/commands/archive/upload-archive-writer.ts +213 -0
- package/src/commands/archive/zip-archive.ts +317 -0
- package/src/commands/attributes-source.ts +26 -12
- package/src/commands/blame-command.ts +1551 -53
- package/src/commands/blame-ignore.ts +307 -0
- package/src/commands/bundle/bundle-create-command.ts +405 -0
- package/src/commands/bundle/bundle-format.ts +228 -0
- package/src/commands/bundle/bundle-list.ts +276 -0
- package/src/commands/bundle/bundle-read-commands.ts +157 -0
- package/src/commands/bundle/bundle-support.ts +85 -0
- package/src/commands/bundle/bundle-transport.ts +107 -0
- package/src/commands/bundle/bundle-uri-host.ts +204 -0
- package/src/commands/bundle/bundle-uri.ts +236 -0
- package/src/commands/bundle/bundle-verify.ts +152 -0
- package/src/commands/bundle/index.ts +14 -0
- package/src/commands/cat-file/batch-format.ts +193 -0
- package/src/commands/cat-file/cat-file-command.ts +857 -0
- package/src/commands/cat-file/index.ts +2 -0
- package/src/commands/check-attr-command.ts +333 -0
- package/src/commands/check-ignore-command.ts +261 -0
- package/src/commands/check-mailmap-command.ts +129 -0
- package/src/commands/check-ref-format-command.ts +129 -0
- package/src/commands/checkout-command.ts +131 -28
- package/src/commands/checkout-index-command.ts +568 -0
- package/src/commands/checkout-paths.ts +35 -0
- package/src/commands/cherry-command.ts +187 -0
- package/src/commands/cherry-pick-command.ts +63 -2
- package/src/commands/clean-command.ts +92 -12
- package/src/commands/clean-interactive.ts +522 -0
- package/src/commands/clone-command.ts +803 -50
- package/src/commands/commit-command.ts +202 -51
- package/src/commands/config-command.ts +9 -0
- package/src/commands/daemon-access-hook.ts +78 -0
- package/src/commands/default-branch.ts +99 -1
- package/src/commands/describe-command.ts +341 -254
- package/src/commands/diff-command.ts +1186 -99
- package/src/commands/diff-external.ts +131 -0
- package/src/commands/diff-plumbing/diff-pairs-command.ts +193 -0
- package/src/commands/diff-plumbing/diff-plumbing-command.ts +424 -0
- package/src/commands/diff-plumbing/index.ts +2 -0
- package/src/commands/diff-textconv.ts +5 -1
- package/src/commands/fast-export/fast-export-command.ts +911 -0
- package/src/commands/fast-export/fast-import-command.ts +1553 -0
- package/src/commands/fast-export/fast-stream-support.ts +162 -0
- package/src/commands/fast-export/index.ts +3 -0
- package/src/commands/fetch-command.ts +665 -14
- package/src/commands/fetch-multiple-command.ts +668 -0
- package/src/commands/format-patch-command.ts +189 -77
- package/src/commands/format-rev-command.ts +251 -0
- package/src/commands/fsck/fsck-command.ts +47 -20
- package/src/commands/fsck/fsck-msg-ids.ts +19 -3
- package/src/commands/fsck/fsck-pack.ts +2 -2
- package/src/commands/fsmonitor-refresh.ts +315 -0
- package/src/commands/gc-command.ts +10 -0
- package/src/commands/git-describe.ts +456 -217
- package/src/commands/git-hooks.ts +165 -9
- package/src/commands/git-paths.ts +136 -0
- package/src/commands/grep/grep-command.ts +38 -15
- package/src/commands/history-command.ts +617 -0
- package/src/commands/http-config.ts +139 -0
- package/src/commands/index-adder.ts +37 -3
- package/src/commands/index-host.ts +6 -1
- package/src/commands/index.ts +62 -0
- package/src/commands/init-command.ts +617 -49
- package/src/commands/last-modified-command.ts +804 -0
- package/src/commands/lfs/go-url.ts +370 -0
- package/src/commands/lfs/index.ts +2 -0
- package/src/commands/lfs/lfs-config.ts +738 -0
- package/src/commands/lfs/lfs-endpoint-command.ts +180 -0
- package/src/commands/line-log.ts +931 -0
- package/src/commands/local-transport.ts +252 -4
- package/src/commands/log-command.ts +1518 -182
- package/src/commands/log-graph.ts +6 -3
- package/src/commands/log-output.ts +228 -15
- package/src/commands/ls-files-command.ts +1177 -0
- package/src/commands/ls-remote-command.ts +6 -0
- package/src/commands/ls-tree-command.ts +684 -0
- package/src/commands/mailmap.ts +41 -5
- package/src/commands/maintenance-run-command.ts +949 -0
- package/src/commands/merge-command.ts +351 -47
- package/src/commands/merge-config.ts +23 -1
- package/src/commands/merge-drivers.ts +112 -20
- package/src/commands/merge-strategy-options.ts +224 -0
- package/src/commands/merge-support.ts +130 -26
- package/src/commands/merge-tree-command.ts +786 -0
- package/src/commands/message-cleanup.ts +1 -1
- package/src/commands/mktag-command.ts +149 -0
- package/src/commands/name-rev-command.ts +184 -0
- package/src/commands/name-rev.ts +700 -109
- package/src/commands/object-store/count-objects-command.ts +404 -0
- package/src/commands/object-store/index.ts +4 -0
- package/src/commands/object-store/objects-directory.ts +24 -0
- package/src/commands/object-store/prune-command.ts +129 -0
- package/src/commands/object-store/show-index-command.ts +151 -0
- package/src/commands/octopus-merge.ts +35 -11
- package/src/commands/ort-merge.ts +124 -23
- package/src/commands/ort-recursive.ts +40 -2
- package/src/commands/patch-id-command.ts +65 -0
- package/src/commands/patch-id.ts +327 -0
- package/src/commands/plumbing-command.ts +141 -0
- package/src/commands/plumbing-input.ts +87 -0
- package/src/commands/promisor-remote-reply.ts +276 -0
- package/src/commands/promisor-remote.ts +25 -2
- package/src/commands/pull-command.ts +720 -224
- package/src/commands/push-command.ts +440 -8
- package/src/commands/range-diff/index.ts +3 -0
- package/src/commands/range-diff/linear-assignment.ts +203 -0
- package/src/commands/range-diff/range-diff-command.ts +433 -0
- package/src/commands/range-diff/range-diff.ts +617 -0
- package/src/commands/read-tree-command.ts +74 -3
- package/src/commands/rebase-command.ts +647 -83
- package/src/commands/refs-command.ts +274 -0
- package/src/commands/remerge-diff.ts +241 -0
- package/src/commands/remote-command.ts +98 -10
- package/src/commands/remote-object-info-command.ts +109 -0
- package/src/commands/remote-show-command.ts +836 -0
- package/src/commands/remote-transport.ts +116 -1
- package/src/commands/repack-command.ts +383 -0
- package/src/commands/replace-command.ts +816 -0
- package/src/commands/replay-command.ts +674 -0
- package/src/commands/repo-command.ts +967 -0
- package/src/commands/request-pull-command.ts +356 -0
- package/src/commands/rerere-command.ts +179 -0
- package/src/commands/rerere.ts +925 -0
- package/src/commands/reset-command.ts +78 -3
- package/src/commands/restore-command.ts +15 -0
- package/src/commands/rev-filter/commit-grep.ts +7 -2
- package/src/commands/rev-list-command.ts +196 -11
- package/src/commands/rev-parse-command.ts +62 -4
- package/src/commands/revert-command.ts +62 -2
- package/src/commands/revision-range.ts +10 -3
- package/src/commands/revision-resolver.ts +44 -3
- package/src/commands/sequencer-pick.ts +370 -29
- package/src/commands/sequencer-support.ts +164 -2
- package/src/commands/serve-repository.ts +65 -0
- package/src/commands/session-id.ts +31 -0
- package/src/commands/shortlog-command.ts +354 -0
- package/src/commands/shortlog.ts +361 -0
- package/src/commands/show-branch-command.ts +981 -0
- package/src/commands/show-command.ts +3 -2
- package/src/commands/show-ref-command.ts +439 -0
- package/src/commands/signature-check.ts +37 -5
- package/src/commands/signing.ts +122 -16
- package/src/commands/stash-apply-command.ts +3 -0
- package/src/commands/stash-export-command.ts +397 -0
- package/src/commands/status-command.ts +158 -31
- package/src/commands/status-format.ts +1 -1
- package/src/commands/stripspace-command.ts +118 -0
- package/src/commands/submodule-add-command.ts +22 -1
- package/src/commands/submodule-auth.ts +61 -6
- package/src/commands/submodule-commands.ts +333 -5
- package/src/commands/submodule-fetch.ts +789 -0
- package/src/commands/submodule-model.ts +9 -1
- package/src/commands/submodule-unpack.ts +265 -0
- package/src/commands/submodule-update-command.ts +68 -5
- package/src/commands/subtree-shift.ts +215 -0
- package/src/commands/switch-command.ts +9 -0
- package/src/commands/textconv-cache.ts +143 -0
- package/src/commands/tree-restore.ts +20 -1
- package/src/commands/unpack-objects-command.ts +235 -0
- package/src/commands/update-index-command.ts +1016 -0
- package/src/commands/uri-protocols.ts +13 -0
- package/src/commands/url-parse-command.ts +67 -0
- package/src/commands/var-command.ts +219 -0
- package/src/commands/worktree-overwrite-checks.ts +5 -0
- package/src/errors/command-errors.ts +80 -0
- package/src/git-command.ts +218 -2
- package/src/git.ts +1033 -80
- package/src/guarded-transport-command.ts +176 -0
- package/src/index.ts +1 -0
- package/src/rename/detect-renames.ts +42 -8
- package/src/rename/diffcore-break.ts +166 -0
- package/src/rename/index.ts +1 -0
- package/src/results/blame-format.ts +268 -43
- package/src/results/cherry-pick-result.ts +6 -0
- package/src/results/clone-result.ts +6 -0
- package/src/results/diff-dirstat.ts +117 -0
- package/src/results/diff-entry.ts +24 -0
- package/src/results/diff-formatter.ts +8 -4
- package/src/results/diff-output.ts +239 -8
- package/src/results/diff-pickaxe.ts +1 -1
- package/src/results/fetch-result.ts +24 -1
- package/src/results/index.ts +2 -0
- package/src/results/init-result.ts +10 -1
- package/src/results/line-range-hunks.ts +126 -0
- package/src/results/merge-result.ts +14 -0
- package/src/results/pull-result.ts +7 -0
- package/src/results/push-result.ts +10 -0
- package/src/results/rebase-result.ts +7 -0
- package/src/results/revert-result.ts +6 -0
- package/src/results/stash-result.ts +6 -0
- package/src/results/status-result.ts +2 -2
- package/src/transport-command.ts +216 -4
- package/dist/fsck-DLRpbwTj.js +0 -13405
- package/dist/results-TB2IJ64h.js +0 -4700
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The repository side of bundle URIs for clone and fetch: downloads (`copy_uri_to_file`),
|
|
3
|
+
* `unbundle_from_file` (the bundle verified quietly, its pack indexed and kept, its refs
|
|
4
|
+
* written under `refs/bundles/`) and `fetch.bundleCreationToken`.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import { historyWithoutLazyFetch, type ObjectId, type RefLogOptions } from "@statewalker/vcs-core";
|
|
8
|
+
import {
|
|
9
|
+
type Credentials,
|
|
10
|
+
createRepositoryFacade,
|
|
11
|
+
type HttpClientSettings,
|
|
12
|
+
type HttpCredentialHelper,
|
|
13
|
+
SmartHttpClient,
|
|
14
|
+
} from "@statewalker/vcs-transport";
|
|
15
|
+
|
|
16
|
+
import type { WorkingCopy } from "../../types.js";
|
|
17
|
+
import type { BundleUriHost } from "./bundle-uri.js";
|
|
18
|
+
import { openBundle, verifyBundleIn } from "./bundle-verify.js";
|
|
19
|
+
|
|
20
|
+
/** What {@link createBundleUriHost} works with. */
|
|
21
|
+
export interface BundleUriHostOptions {
|
|
22
|
+
workingCopy: WorkingCopy;
|
|
23
|
+
/** Writes a ref (no old value checked: git reads it right before) */
|
|
24
|
+
setRef(name: string, id: ObjectId, log: RefLogOptions): Promise<void>;
|
|
25
|
+
/** Reads a ref's value */
|
|
26
|
+
getRef(name: string): Promise<ObjectId | undefined>;
|
|
27
|
+
/** The reflog entry of a write (`fetched bundle`) */
|
|
28
|
+
reflogLine(message: string): RefLogOptions;
|
|
29
|
+
/**
|
|
30
|
+
* git 2.43 maps only `refs/heads/<name>` to `refs/bundles/<name>`; 2.5x maps every
|
|
31
|
+
* `refs/<name>` to `refs/bundles/<name>` (tags too)
|
|
32
|
+
*/
|
|
33
|
+
compatibility?: "2.43" | "2.56";
|
|
34
|
+
/** A local path's bytes (relative paths as the clone resolves its source) */
|
|
35
|
+
readLocalFile(path: string): Promise<Uint8Array | undefined>;
|
|
36
|
+
/** HTTP: the remote's URL; static credentials and headers go only to its origin */
|
|
37
|
+
remoteUrl?: string;
|
|
38
|
+
credentials?: Credentials;
|
|
39
|
+
headers?: Record<string, string>;
|
|
40
|
+
credentialHelper?: HttpCredentialHelper;
|
|
41
|
+
httpSettings?(url: string): HttpClientSettings;
|
|
42
|
+
fetchImpl?: (request: Request) => Promise<Response>;
|
|
43
|
+
/** Reads `fetch.bundleCreationToken` */
|
|
44
|
+
configValue(key: string): string | null | undefined;
|
|
45
|
+
/** Stores `fetch.bundleCreationToken` */
|
|
46
|
+
setConfigValue(key: string, value: string): Promise<void>;
|
|
47
|
+
message(line: string): void;
|
|
48
|
+
/** How the downloaded list file is named in errors */
|
|
49
|
+
tempFileName?(): string;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/** The origin of a URL, or undefined for one `new URL` cannot read. */
|
|
53
|
+
function originOf(url: string): string | undefined {
|
|
54
|
+
try {
|
|
55
|
+
return new URL(url).origin;
|
|
56
|
+
} catch {
|
|
57
|
+
return undefined;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/** A host over a repository (see {@link BundleUriHostOptions}). */
|
|
62
|
+
export function createBundleUriHost(options: BundleUriHostOptions): BundleUriHost {
|
|
63
|
+
const history = options.workingCopy.history;
|
|
64
|
+
return {
|
|
65
|
+
async download(uri) {
|
|
66
|
+
if (/^https?:/.test(uri)) return downloadHttp(options, uri);
|
|
67
|
+
// copy_uri_to_file: `file://` dropped, anything else copied as a path
|
|
68
|
+
const path = uri.startsWith("file://") ? uri.slice("file://".length) : uri;
|
|
69
|
+
return options.readLocalFile(path).catch(() => undefined);
|
|
70
|
+
},
|
|
71
|
+
async unbundle(bytes) {
|
|
72
|
+
const opened = openBundle(bytes, "<bundle>");
|
|
73
|
+
if (!opened.ok) return false;
|
|
74
|
+
const { header, pack } = opened.bundle;
|
|
75
|
+
const objects = historyWithoutLazyFetch(history);
|
|
76
|
+
const verified = await verifyBundleIn(
|
|
77
|
+
{
|
|
78
|
+
history,
|
|
79
|
+
refValues: () => refValuesOf(history.refs),
|
|
80
|
+
shallow: async () => (await history.refs.getShallow?.().catch(() => undefined)) ?? [],
|
|
81
|
+
},
|
|
82
|
+
header,
|
|
83
|
+
{ quiet: true },
|
|
84
|
+
);
|
|
85
|
+
for (const line of verified.stderr.split("\n")) if (line) options.message(line);
|
|
86
|
+
if (!verified.ok) return false;
|
|
87
|
+
const facade = createRepositoryFacade({ history: objects });
|
|
88
|
+
let packId: string | undefined;
|
|
89
|
+
try {
|
|
90
|
+
const imported = await facade.importPack(
|
|
91
|
+
(async function* () {
|
|
92
|
+
yield pack;
|
|
93
|
+
})(),
|
|
94
|
+
{ keepPack: true },
|
|
95
|
+
);
|
|
96
|
+
packId = imported.packId;
|
|
97
|
+
} catch (error) {
|
|
98
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
99
|
+
options.message(message.startsWith("fatal: ") ? message : `fatal: ${message}`);
|
|
100
|
+
options.message("error: index-pack died");
|
|
101
|
+
return false;
|
|
102
|
+
}
|
|
103
|
+
if (header.filter !== undefined && packId !== undefined) {
|
|
104
|
+
await facade.markPromisorPack?.(packId, "from-bundle\n");
|
|
105
|
+
}
|
|
106
|
+
for (const ref of header.references) {
|
|
107
|
+
if (!ref.name.startsWith("refs/")) continue;
|
|
108
|
+
let target: string;
|
|
109
|
+
if (options.compatibility === "2.43") {
|
|
110
|
+
if (!ref.name.startsWith("refs/heads/")) continue;
|
|
111
|
+
target = `refs/bundles/${ref.name.slice("refs/heads/".length)}`;
|
|
112
|
+
} else {
|
|
113
|
+
target = `refs/bundles/${ref.name.slice("refs/".length)}`;
|
|
114
|
+
}
|
|
115
|
+
// refs_update_ref with UPDATE_REFS_MSG_ON_ERR: a failure is reported, not fatal
|
|
116
|
+
if (!(await objectExists(objects, ref.id))) {
|
|
117
|
+
options.message(
|
|
118
|
+
`error: trying to write ref '${target}' with nonexistent object ${ref.id}`,
|
|
119
|
+
);
|
|
120
|
+
continue;
|
|
121
|
+
}
|
|
122
|
+
try {
|
|
123
|
+
await options.setRef(target, ref.id, options.reflogLine("fetched bundle"));
|
|
124
|
+
} catch (error) {
|
|
125
|
+
options.message(`error: ${error instanceof Error ? error.message : String(error)}`);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
return true;
|
|
129
|
+
},
|
|
130
|
+
creationToken: () => options.configValue("fetch.bundleCreationToken"),
|
|
131
|
+
setCreationToken: (value) => options.setConfigValue("fetch.bundleCreationToken", value),
|
|
132
|
+
message: (line) => options.message(line),
|
|
133
|
+
...(options.tempFileName ? { tempFileName: options.tempFileName } : {}),
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* `download_https_uri_to_file` (git-remote-https's `get`): a URI holding a space or a newline
|
|
139
|
+
* is refused (the remote helper's protocol separates on them); a response that is not 2xx
|
|
140
|
+
* fails. The command's static credentials and headers go only to the remote's own origin
|
|
141
|
+
* (the list is the server's content and may name any host); the credential helper is asked
|
|
142
|
+
* per URL, as git's helper is.
|
|
143
|
+
*/
|
|
144
|
+
async function downloadHttp(
|
|
145
|
+
options: BundleUriHostOptions,
|
|
146
|
+
uri: string,
|
|
147
|
+
): Promise<Uint8Array | undefined> {
|
|
148
|
+
if (/[ \n]/.test(uri)) {
|
|
149
|
+
options.message(`error: bundle-uri: URI is malformed: '${uri}'`);
|
|
150
|
+
return undefined;
|
|
151
|
+
}
|
|
152
|
+
const sameOrigin =
|
|
153
|
+
options.remoteUrl !== undefined &&
|
|
154
|
+
originOf(uri) !== undefined &&
|
|
155
|
+
originOf(uri) === originOf(options.remoteUrl);
|
|
156
|
+
const controller = new AbortController();
|
|
157
|
+
const client = new SmartHttpClient({
|
|
158
|
+
url: uri,
|
|
159
|
+
fetchImpl: options.fetchImpl ?? ((request) => fetch(request)),
|
|
160
|
+
signal: controller.signal,
|
|
161
|
+
...(sameOrigin && options.headers ? { headers: options.headers } : {}),
|
|
162
|
+
...(sameOrigin && options.credentials ? { auth: options.credentials } : {}),
|
|
163
|
+
...(options.httpSettings ? { settings: options.httpSettings(uri) } : {}),
|
|
164
|
+
...(options.credentialHelper ? { credentialHelper: options.credentialHelper } : {}),
|
|
165
|
+
});
|
|
166
|
+
try {
|
|
167
|
+
const response = await client.get(uri, (next) => next());
|
|
168
|
+
if (!response.ok) {
|
|
169
|
+
await response.body?.cancel().catch(() => undefined);
|
|
170
|
+
return undefined;
|
|
171
|
+
}
|
|
172
|
+
return new Uint8Array(await response.arrayBuffer());
|
|
173
|
+
} catch {
|
|
174
|
+
return undefined;
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
/** Every ref's value and HEAD's (what `rev-list --all` starts from). */
|
|
179
|
+
async function refValuesOf(refs: WorkingCopy["history"]["refs"]): Promise<string[]> {
|
|
180
|
+
const out = new Set<string>();
|
|
181
|
+
for await (const ref of refs.list()) {
|
|
182
|
+
const id =
|
|
183
|
+
"objectId" in ref && ref.objectId
|
|
184
|
+
? ref.objectId
|
|
185
|
+
: (await refs.resolve(ref.name).catch(() => undefined))?.objectId;
|
|
186
|
+
if (id) out.add(id);
|
|
187
|
+
}
|
|
188
|
+
const head = (await refs.resolve("HEAD").catch(() => undefined))?.objectId;
|
|
189
|
+
if (head) out.add(head);
|
|
190
|
+
return [...out];
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
/** git's `parse_object`-free existence check of an object. */
|
|
194
|
+
async function objectExists(
|
|
195
|
+
history: ReturnType<typeof historyWithoutLazyFetch>,
|
|
196
|
+
id: ObjectId,
|
|
197
|
+
): Promise<boolean> {
|
|
198
|
+
const objects = (history as { objects?: { has(id: ObjectId): Promise<boolean> } }).objects;
|
|
199
|
+
if (objects) return objects.has(id).catch(() => false);
|
|
200
|
+
for (const store of [history.commits, history.trees, history.blobs, history.tags]) {
|
|
201
|
+
if (await store.has(id).catch(() => false)) return true;
|
|
202
|
+
}
|
|
203
|
+
return false;
|
|
204
|
+
}
|
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bundle URIs on the client (bundle-uri.c): before a clone or a fetch talks to the remote,
|
|
3
|
+
* bundles are downloaded from a URI (`git clone --bundle-uri`, `fetch.bundleURI`) or from the
|
|
4
|
+
* list the server advertises (`transfer.bundleURI`, the v2 `bundle-uri` command) and
|
|
5
|
+
* unbundled into the repository, their refs written under `refs/bundles/`. The fetch that
|
|
6
|
+
* follows then has them as local tips, so it asks only for what they lack.
|
|
7
|
+
*
|
|
8
|
+
* The engine is the host's: {@link BundleUriHost} downloads a URI, unbundles bytes and reads
|
|
9
|
+
* and writes `fetch.bundleCreationToken`. {@link fetchBundleUri} and {@link fetchBundleList}
|
|
10
|
+
* follow git's walk, its recursion limit, `all`/`any` modes and the `creationToken`
|
|
11
|
+
* heuristic, and give git's warnings in order.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
import { parseBundleHeader } from "./bundle-format.js";
|
|
15
|
+
import { BundleList, parseBundleListConfig, type RemoteBundleInfo } from "./bundle-list.js";
|
|
16
|
+
|
|
17
|
+
/** What the walk needs of the repository and the network. */
|
|
18
|
+
export interface BundleUriHost {
|
|
19
|
+
/**
|
|
20
|
+
* `copy_uri_to_file`: the bytes at `uri` (an `http(s)://` URL, a `file://` URL or a path),
|
|
21
|
+
* or undefined when they cannot be had (git's warning follows)
|
|
22
|
+
*/
|
|
23
|
+
download(uri: string): Promise<Uint8Array | undefined>;
|
|
24
|
+
/**
|
|
25
|
+
* `unbundle_from_file`: the bundle verified (quietly) and its pack indexed, then its refs
|
|
26
|
+
* written under `refs/bundles/`; false when the header, the prerequisites or the pack fail
|
|
27
|
+
*/
|
|
28
|
+
unbundle(bytes: Uint8Array): Promise<boolean>;
|
|
29
|
+
/** `fetch.bundleCreationToken` as set (undefined: unset; null: set without a value) */
|
|
30
|
+
creationToken(): string | null | undefined;
|
|
31
|
+
/** Stores `fetch.bundleCreationToken` in the repository's config */
|
|
32
|
+
setCreationToken(value: string): Promise<void>;
|
|
33
|
+
/** A line git prints on stderr (`warning: ...`, `error: ...`) */
|
|
34
|
+
message(line: string): void;
|
|
35
|
+
/**
|
|
36
|
+
* How git names a downloaded list in its `bad config line` error (its temporary file,
|
|
37
|
+
* `<objects>/bundles/tmp_uri_XXXXXX`)
|
|
38
|
+
*/
|
|
39
|
+
tempFileName?(): string;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/** bundle-uri.c's `max_bundle_uri_depth`. */
|
|
43
|
+
const MAX_BUNDLE_URI_DEPTH = 4;
|
|
44
|
+
|
|
45
|
+
/** Whether the bytes read as a bundle (`is_bundle`: the whole header parses). */
|
|
46
|
+
export function isBundle(bytes: Uint8Array): boolean {
|
|
47
|
+
return parseBundleHeader(bytes).ok;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* `fetch_bundle_uri_internal`: downloads `bundle`; a bundle is added to `global` (applied
|
|
52
|
+
* later), anything else is read as a bundle list and followed. True when it worked.
|
|
53
|
+
*/
|
|
54
|
+
async function fetchBundleUriInternal(
|
|
55
|
+
host: BundleUriHost,
|
|
56
|
+
bundle: RemoteBundleInfo,
|
|
57
|
+
depth: number,
|
|
58
|
+
global: BundleList,
|
|
59
|
+
): Promise<boolean> {
|
|
60
|
+
if (depth >= MAX_BUNDLE_URI_DEPTH) {
|
|
61
|
+
host.message(`warning: exceeded bundle URI recursion limit (${MAX_BUNDLE_URI_DEPTH})`);
|
|
62
|
+
return false;
|
|
63
|
+
}
|
|
64
|
+
if (bundle.uri === undefined) {
|
|
65
|
+
host.message(`error: bundle '${bundle.id}' has no uri`);
|
|
66
|
+
return false;
|
|
67
|
+
}
|
|
68
|
+
const bytes = await host.download(bundle.uri);
|
|
69
|
+
if (bytes === undefined) {
|
|
70
|
+
bundle.file = null;
|
|
71
|
+
host.message(`warning: failed to download bundle from URI '${bundle.uri}'`);
|
|
72
|
+
return false;
|
|
73
|
+
}
|
|
74
|
+
bundle.file = bytes;
|
|
75
|
+
if (!isBundle(bytes)) {
|
|
76
|
+
const ok = await fetchBundleListInConfigFormat(host, global, bundle, bytes, depth);
|
|
77
|
+
if (!ok) {
|
|
78
|
+
bundle.file = null;
|
|
79
|
+
host.message(`warning: file at URI '${bundle.uri}' is not a bundle or bundle list`);
|
|
80
|
+
}
|
|
81
|
+
return ok;
|
|
82
|
+
}
|
|
83
|
+
global.add({ id: bundle.id, file: bytes, creationToken: 0n });
|
|
84
|
+
return true;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/** `fetch_bundle_list_in_config_format`: the downloaded list followed. */
|
|
88
|
+
async function fetchBundleListInConfigFormat(
|
|
89
|
+
host: BundleUriHost,
|
|
90
|
+
global: BundleList,
|
|
91
|
+
bundle: RemoteBundleInfo,
|
|
92
|
+
bytes: Uint8Array,
|
|
93
|
+
depth: number,
|
|
94
|
+
): Promise<boolean> {
|
|
95
|
+
const list = new BundleList();
|
|
96
|
+
const messages: string[] = [];
|
|
97
|
+
const parsed = await parseBundleListConfig(
|
|
98
|
+
bundle.uri ?? "",
|
|
99
|
+
bytes,
|
|
100
|
+
host.tempFileName?.() ?? "<bundle list>",
|
|
101
|
+
list,
|
|
102
|
+
messages,
|
|
103
|
+
);
|
|
104
|
+
for (const line of messages) host.message(line);
|
|
105
|
+
if (!parsed) return false;
|
|
106
|
+
// a creationToken list advertises bundles, not nested lists
|
|
107
|
+
if (list.heuristic === "creationToken") {
|
|
108
|
+
const ok = await fetchBundlesByToken(host, list);
|
|
109
|
+
global.heuristic = "creationToken";
|
|
110
|
+
return ok;
|
|
111
|
+
}
|
|
112
|
+
await downloadBundleList(host, list, global, depth);
|
|
113
|
+
return true;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/** `download_bundle_list`: each bundle of `local` fetched into `global` (one in `any` mode). */
|
|
117
|
+
async function downloadBundleList(
|
|
118
|
+
host: BundleUriHost,
|
|
119
|
+
local: BundleList,
|
|
120
|
+
global: BundleList,
|
|
121
|
+
depth: number,
|
|
122
|
+
): Promise<void> {
|
|
123
|
+
let count = 0;
|
|
124
|
+
for (const bundle of local.bundles()) {
|
|
125
|
+
if (local.mode === "any" && count > 0) continue;
|
|
126
|
+
// download_bundle_to_file recurses at ctx->depth + 1 with ctx->depth = depth + 1
|
|
127
|
+
if (await fetchBundleUriInternal(host, bundle, depth + 2, global)) count++;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* `fetch_bundles_by_token`: the bundles newest first, downloaded until one unbundles, then
|
|
133
|
+
* back towards the newest, applying each; `fetch.bundleCreationToken` stops the walk at what
|
|
134
|
+
* an earlier fetch applied, and is set to the newest token applied when the walk completes.
|
|
135
|
+
* False where git returns nonzero (the walk ran off the end of the list).
|
|
136
|
+
*/
|
|
137
|
+
async function fetchBundlesByToken(host: BundleUriHost, list: BundleList): Promise<boolean> {
|
|
138
|
+
const bundles = list.bundles();
|
|
139
|
+
if (bundles.length === 0) return true;
|
|
140
|
+
// QSORT (glibc's merge sort: stable) by creationToken, decreasing
|
|
141
|
+
bundles.sort((a, b) =>
|
|
142
|
+
a.creationToken > b.creationToken ? -1 : a.creationToken < b.creationToken ? 1 : 0,
|
|
143
|
+
);
|
|
144
|
+
let maxToken = 0n;
|
|
145
|
+
let newMaxToken = 0n;
|
|
146
|
+
const stored = host.creationToken();
|
|
147
|
+
if (stored !== undefined) {
|
|
148
|
+
const match = stored === null ? null : /^\s*(\d+)/.exec(stored);
|
|
149
|
+
maxToken = match ? BigInt(match[1] ?? "0") % (1n << 64n) : 0n;
|
|
150
|
+
if ((bundles[0]?.creationToken ?? 0n) <= maxToken) return true;
|
|
151
|
+
}
|
|
152
|
+
let cur = 0;
|
|
153
|
+
let direction = 0;
|
|
154
|
+
while (cur >= 0 && cur < bundles.length) {
|
|
155
|
+
const bundle = bundles[cur] as RemoteBundleInfo;
|
|
156
|
+
if (bundle.creationToken <= maxToken) break;
|
|
157
|
+
let skipUnbundle = false;
|
|
158
|
+
if (bundle.file === undefined) {
|
|
159
|
+
if (!(await fetchBundleUriInternal(host, bundle, 1, list))) {
|
|
160
|
+
bundle.unbundled = true;
|
|
161
|
+
direction = 1;
|
|
162
|
+
skipUnbundle = true;
|
|
163
|
+
} else if (!bundle.file || !isBundle(bundle.file)) {
|
|
164
|
+
host.message(`warning: file downloaded from '${bundle.uri}' is not a bundle`);
|
|
165
|
+
break;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
if (!skipUnbundle && bundle.file && !bundle.unbundled) {
|
|
169
|
+
if (!(await host.unbundle(bundle.file))) {
|
|
170
|
+
direction = 1;
|
|
171
|
+
} else {
|
|
172
|
+
direction = -1;
|
|
173
|
+
bundle.unbundled = true;
|
|
174
|
+
if (bundle.creationToken > newMaxToken) newMaxToken = bundle.creationToken;
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
cur += direction;
|
|
178
|
+
}
|
|
179
|
+
if (cur < 0) {
|
|
180
|
+
try {
|
|
181
|
+
await host.setCreationToken(String(newMaxToken));
|
|
182
|
+
} catch {
|
|
183
|
+
host.message("warning: failed to store maximum creation token");
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
return cur < 0;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* `unbundle_all_bundles`: passes over the list applying what applies, until a pass applies
|
|
191
|
+
* nothing (a bundle may need another's objects first).
|
|
192
|
+
*/
|
|
193
|
+
async function unbundleAllBundles(host: BundleUriHost, list: BundleList): Promise<void> {
|
|
194
|
+
for (;;) {
|
|
195
|
+
let applied = false;
|
|
196
|
+
for (const bundle of list.bundles()) {
|
|
197
|
+
if (!bundle.file || bundle.unbundled) continue;
|
|
198
|
+
if (await host.unbundle(bundle.file)) {
|
|
199
|
+
bundle.unbundled = true;
|
|
200
|
+
applied = true;
|
|
201
|
+
break;
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
if (!applied) return;
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
/**
|
|
209
|
+
* `fetch_bundle_uri`: the bundle (or bundle list) at `uri` downloaded and applied. An empty
|
|
210
|
+
* URI does nothing (a configured `fetch.bundleURI` turned off). `ok` false where git returns
|
|
211
|
+
* nonzero (its warnings already given); `hasHeuristic` when a list used `creationToken` (git's
|
|
212
|
+
* clone then stores the URI as `fetch.bundleURI`).
|
|
213
|
+
*/
|
|
214
|
+
export async function fetchBundleUri(
|
|
215
|
+
host: BundleUriHost,
|
|
216
|
+
uri: string,
|
|
217
|
+
): Promise<{ ok: boolean; hasHeuristic: boolean }> {
|
|
218
|
+
const list = new BundleList();
|
|
219
|
+
if (uri === "") return { ok: true, hasHeuristic: false };
|
|
220
|
+
const bundle: RemoteBundleInfo = { id: "", uri, creationToken: 0n };
|
|
221
|
+
const ok = await fetchBundleUriInternal(host, bundle, 0, list);
|
|
222
|
+
if (ok) await unbundleAllBundles(host, list);
|
|
223
|
+
return { ok, hasHeuristic: list.heuristic !== undefined };
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
/**
|
|
227
|
+
* `fetch_bundle_list`: the list a server advertised, downloaded and applied (by token under
|
|
228
|
+
* the `creationToken` heuristic). False where git warns `failed to fetch advertised bundles`.
|
|
229
|
+
*/
|
|
230
|
+
export async function fetchBundleList(host: BundleUriHost, list: BundleList): Promise<boolean> {
|
|
231
|
+
if (list.heuristic === "creationToken") return fetchBundlesByToken(host, list);
|
|
232
|
+
const global = new BundleList();
|
|
233
|
+
await downloadBundleList(host, list, global, 0);
|
|
234
|
+
await unbundleAllBundles(host, global);
|
|
235
|
+
return true;
|
|
236
|
+
}
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* bundle.c's reading side without a command: a bundle's bytes read (`read_bundle_header`)
|
|
3
|
+
* and checked against a repository (`verify_bundle`), as the bundle commands and the bundle
|
|
4
|
+
* transport do.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import { type History, historyWithoutLazyFetch, type ObjectId } from "@statewalker/vcs-core";
|
|
8
|
+
import { connectivityErrors, createRepositoryFacade } from "@statewalker/vcs-transport";
|
|
9
|
+
|
|
10
|
+
import { type BundleHeader, listBundleRefs, parseBundleHeader } from "./bundle-format.js";
|
|
11
|
+
|
|
12
|
+
/** git's text and exit status for a bundle command. */
|
|
13
|
+
export interface BundleCommandResult {
|
|
14
|
+
/** 0, or git's exit status (1 for an `error()` return) */
|
|
15
|
+
exitCode: number;
|
|
16
|
+
/** What git prints on stdout */
|
|
17
|
+
stdout: string;
|
|
18
|
+
/** What git prints on stderr (`error:` lines, `<file> is okay`) */
|
|
19
|
+
stderr: string;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/** How {@link BundleCommandBase.verifyBundle} reports (bundle.h `verify_bundle_flags`). */
|
|
23
|
+
export interface VerifyBundleOptions {
|
|
24
|
+
/** VERIFY_BUNDLE_VERBOSE: the refs, the prerequisites, the hash and filter on stdout */
|
|
25
|
+
verbose?: boolean;
|
|
26
|
+
/** VERIFY_BUNDLE_QUIET: no line per missing prerequisite */
|
|
27
|
+
quiet?: boolean;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/** A bundle's bytes as the commands take them: whole, or a stream of chunks. */
|
|
31
|
+
export type BundleInput = Uint8Array | AsyncIterable<Uint8Array> | Iterable<Uint8Array>;
|
|
32
|
+
|
|
33
|
+
/** The bytes of a {@link BundleInput}, collected. */
|
|
34
|
+
export async function bundleBytes(input: BundleInput): Promise<Uint8Array> {
|
|
35
|
+
if (input instanceof Uint8Array) return input;
|
|
36
|
+
const chunks: Uint8Array[] = [];
|
|
37
|
+
let length = 0;
|
|
38
|
+
for await (const chunk of input as AsyncIterable<Uint8Array>) {
|
|
39
|
+
chunks.push(chunk);
|
|
40
|
+
length += chunk.length;
|
|
41
|
+
}
|
|
42
|
+
const out = new Uint8Array(length);
|
|
43
|
+
let at = 0;
|
|
44
|
+
for (const chunk of chunks) {
|
|
45
|
+
out.set(chunk, at);
|
|
46
|
+
at += chunk.length;
|
|
47
|
+
}
|
|
48
|
+
return out;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/** A bundle read: its header and its pack. */
|
|
52
|
+
export interface OpenedBundle {
|
|
53
|
+
header: BundleHeader;
|
|
54
|
+
pack: Uint8Array;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* builtin/bundle.c's `open_bundle` (`read_bundle_header`): the header and the pack, or git's
|
|
59
|
+
* `error:` line (the bundle reported as `name`: its path, `<stdin>` for `-`).
|
|
60
|
+
*/
|
|
61
|
+
export function openBundle(
|
|
62
|
+
bytes: Uint8Array,
|
|
63
|
+
name: string,
|
|
64
|
+
): { ok: true; bundle: OpenedBundle } | { ok: false; error: string } {
|
|
65
|
+
const parsed = parseBundleHeader(bytes, name);
|
|
66
|
+
if (!parsed.ok) return { ok: false, error: `error: ${parsed.error}\n` };
|
|
67
|
+
return { ok: true, bundle: { header: parsed.header, pack: bytes.subarray(parsed.packOffset) } };
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/** What {@link verifyBundleIn} reads of a repository. */
|
|
71
|
+
export interface BundleVerifyRepository {
|
|
72
|
+
history: History;
|
|
73
|
+
/** What `rev-list --all` starts from: every ref's value and HEAD's */
|
|
74
|
+
refValues(): Promise<ObjectId[]>;
|
|
75
|
+
/** The repository's shallow commits */
|
|
76
|
+
shallow(): Promise<ObjectId[]>;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* bundle.c's `verify_bundle`: every prerequisite must be an object here (each missing one
|
|
81
|
+
* on an `error:` line after `Repository lacks these prerequisite commits:`, unless quiet),
|
|
82
|
+
* then connected to the refs (`check_connected` of the prerequisites, `--not --all`); with
|
|
83
|
+
* `verbose`, what the bundle holds on stdout.
|
|
84
|
+
*/
|
|
85
|
+
export async function verifyBundleIn(
|
|
86
|
+
repository: BundleVerifyRepository,
|
|
87
|
+
header: BundleHeader,
|
|
88
|
+
options: VerifyBundleOptions = {},
|
|
89
|
+
): Promise<{ ok: boolean; stdout: string; stderr: string }> {
|
|
90
|
+
const objects = historyWithoutLazyFetch(repository.history);
|
|
91
|
+
let stderr = "";
|
|
92
|
+
let missing = 0;
|
|
93
|
+
for (const prerequisite of header.prerequisites) {
|
|
94
|
+
if (await objectExists(objects, prerequisite.id)) continue;
|
|
95
|
+
missing++;
|
|
96
|
+
if (options.quiet) continue;
|
|
97
|
+
if (missing === 1) stderr += "error: Repository lacks these prerequisite commits:\n";
|
|
98
|
+
stderr += `error: ${prerequisite.id} \n`;
|
|
99
|
+
}
|
|
100
|
+
if (missing > 0) return { ok: false, stdout: "", stderr };
|
|
101
|
+
let ok = true;
|
|
102
|
+
const tips = header.prerequisites.map((p) => p.id);
|
|
103
|
+
if (tips.length > 0) {
|
|
104
|
+
const facade = createRepositoryFacade({ history: objects });
|
|
105
|
+
const lines = await connectivityErrors(facade, tips, {
|
|
106
|
+
known: await repository.refValues(),
|
|
107
|
+
shallow: new Set(await repository.shallow()),
|
|
108
|
+
});
|
|
109
|
+
if (lines) {
|
|
110
|
+
ok = false;
|
|
111
|
+
stderr +=
|
|
112
|
+
"error: some prerequisite commits exist in the object store, " +
|
|
113
|
+
"but are not connected to the repository's history\n";
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
let stdout = "";
|
|
117
|
+
if (options.verbose) {
|
|
118
|
+
const refs = header.references;
|
|
119
|
+
stdout +=
|
|
120
|
+
refs.length === 1
|
|
121
|
+
? "The bundle contains this ref:\n"
|
|
122
|
+
: `The bundle contains these ${refs.length} refs:\n`;
|
|
123
|
+
stdout += listBundleRefs(refs);
|
|
124
|
+
const prereqs = header.prerequisites;
|
|
125
|
+
if (prereqs.length === 0) stdout += "The bundle records a complete history.\n";
|
|
126
|
+
else {
|
|
127
|
+
stdout +=
|
|
128
|
+
prereqs.length === 1
|
|
129
|
+
? "The bundle requires this ref:\n"
|
|
130
|
+
: `The bundle requires these ${prereqs.length} refs:\n`;
|
|
131
|
+
stdout += listBundleRefs(prereqs);
|
|
132
|
+
}
|
|
133
|
+
stdout += `The bundle uses this hash algorithm: ${header.objectFormat.name}\n`;
|
|
134
|
+
if (header.filter !== undefined) {
|
|
135
|
+
stdout += `The bundle uses this filter: ${header.filter}\n`;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
return { ok, stdout, stderr };
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/** git's `parse_object` succeeds: the object is here, whatever its type. */
|
|
142
|
+
async function objectExists(
|
|
143
|
+
history: ReturnType<typeof historyWithoutLazyFetch>,
|
|
144
|
+
id: ObjectId,
|
|
145
|
+
): Promise<boolean> {
|
|
146
|
+
const objects = (history as { objects?: { has(id: ObjectId): Promise<boolean> } }).objects;
|
|
147
|
+
if (objects) return objects.has(id).catch(() => false);
|
|
148
|
+
for (const store of [history.commits, history.trees, history.blobs, history.tags]) {
|
|
149
|
+
if (await store.has(id).catch(() => false)) return true;
|
|
150
|
+
}
|
|
151
|
+
return false;
|
|
152
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* git's bundles: `git bundle create`, `verify`, `list-heads`, `unbundle`, the format (v2 and
|
|
3
|
+
* v3, bundle.c) and the bundle transport fetch, clone and ls-remote read a bundle file through.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
export * from "./bundle-create-command.js";
|
|
7
|
+
export * from "./bundle-format.js";
|
|
8
|
+
export * from "./bundle-list.js";
|
|
9
|
+
export * from "./bundle-read-commands.js";
|
|
10
|
+
export * from "./bundle-support.js";
|
|
11
|
+
export * from "./bundle-transport.js";
|
|
12
|
+
export * from "./bundle-uri.js";
|
|
13
|
+
export * from "./bundle-uri-host.js";
|
|
14
|
+
export * from "./bundle-verify.js";
|