@statewalker/vcs-commands 0.5.0 → 0.7.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 +123 -8
- package/dist/commands/add-command.d.ts +265 -34
- package/dist/commands/add-command.d.ts.map +1 -1
- package/dist/commands/add-patch/add-interactive.d.ts +46 -0
- package/dist/commands/add-patch/add-interactive.d.ts.map +1 -0
- package/dist/commands/add-patch/add-patch.d.ts +139 -0
- package/dist/commands/add-patch/add-patch.d.ts.map +1 -0
- package/dist/commands/add-patch/index.d.ts +6 -0
- package/dist/commands/add-patch/index.d.ts.map +1 -0
- package/dist/commands/add-patch/patch-backend.d.ts +80 -0
- package/dist/commands/add-patch/patch-backend.d.ts.map +1 -0
- package/dist/commands/add-patch/patch-modes.d.ts +71 -0
- package/dist/commands/add-patch/patch-modes.d.ts.map +1 -0
- package/dist/commands/add-patch/patch-session.d.ts +49 -0
- package/dist/commands/add-patch/patch-session.d.ts.map +1 -0
- package/dist/commands/am/am-command.d.ts +175 -0
- package/dist/commands/am/am-command.d.ts.map +1 -0
- package/dist/commands/am/index.d.ts +3 -0
- package/dist/commands/am/index.d.ts.map +1 -0
- package/dist/commands/am/mailinfo.d.ts +58 -0
- package/dist/commands/am/mailinfo.d.ts.map +1 -0
- package/dist/commands/am/patch-format.d.ts +24 -0
- package/dist/commands/am/patch-format.d.ts.map +1 -0
- package/dist/commands/apply/apply-command.d.ts +153 -0
- package/dist/commands/apply/apply-command.d.ts.map +1 -0
- package/dist/commands/apply/apply-engine.d.ts +195 -0
- package/dist/commands/apply/apply-engine.d.ts.map +1 -0
- package/dist/commands/apply/apply-parse.d.ts +86 -0
- package/dist/commands/apply/apply-parse.d.ts.map +1 -0
- package/dist/commands/apply/apply-types.d.ts +70 -0
- package/dist/commands/apply/apply-types.d.ts.map +1 -0
- package/dist/commands/apply/index.d.ts +6 -0
- package/dist/commands/apply/index.d.ts.map +1 -0
- package/dist/commands/apply/latin1.d.ts +32 -0
- package/dist/commands/apply/latin1.d.ts.map +1 -0
- package/dist/commands/apply/whitespace.d.ts +58 -0
- package/dist/commands/apply/whitespace.d.ts.map +1 -0
- package/dist/commands/attributes-source.d.ts +26 -0
- package/dist/commands/attributes-source.d.ts.map +1 -0
- package/dist/commands/backfill-command.d.ts +110 -0
- package/dist/commands/backfill-command.d.ts.map +1 -0
- package/dist/commands/bisect/bisect-checkout.d.ts +64 -0
- package/dist/commands/bisect/bisect-checkout.d.ts.map +1 -0
- package/dist/commands/bisect/bisect-command.d.ts +201 -0
- package/dist/commands/bisect/bisect-command.d.ts.map +1 -0
- package/dist/commands/bisect/bisect-engine.d.ts +219 -0
- package/dist/commands/bisect/bisect-engine.d.ts.map +1 -0
- package/dist/commands/bisect/bisect-graph.d.ts +127 -0
- package/dist/commands/bisect/bisect-graph.d.ts.map +1 -0
- package/dist/commands/bisect/bisect-quote.d.ts +27 -0
- package/dist/commands/bisect/bisect-quote.d.ts.map +1 -0
- package/dist/commands/bisect/index.d.ts +5 -0
- package/dist/commands/bisect/index.d.ts.map +1 -0
- package/dist/commands/blame-command.d.ts +122 -131
- package/dist/commands/blame-command.d.ts.map +1 -1
- package/dist/commands/branch-command.d.ts +52 -2
- package/dist/commands/branch-command.d.ts.map +1 -1
- package/dist/commands/branch-tracking.d.ts +98 -0
- package/dist/commands/branch-tracking.d.ts.map +1 -0
- package/dist/commands/checkout-command.d.ts +300 -18
- package/dist/commands/checkout-command.d.ts.map +1 -1
- package/dist/commands/checkout-paths.d.ts +124 -0
- package/dist/commands/checkout-paths.d.ts.map +1 -0
- package/dist/commands/cherry-pick-command.d.ts +50 -42
- package/dist/commands/cherry-pick-command.d.ts.map +1 -1
- package/dist/commands/clean-command.d.ts +49 -16
- package/dist/commands/clean-command.d.ts.map +1 -1
- package/dist/commands/clone-command.d.ts +134 -0
- package/dist/commands/clone-command.d.ts.map +1 -1
- package/dist/commands/comment-char-config.d.ts +35 -0
- package/dist/commands/comment-char-config.d.ts.map +1 -0
- package/dist/commands/commit-command.d.ts +311 -17
- package/dist/commands/commit-command.d.ts.map +1 -1
- package/dist/commands/core-config.d.ts +78 -1
- package/dist/commands/core-config.d.ts.map +1 -1
- package/dist/commands/date-format.d.ts +58 -0
- package/dist/commands/date-format.d.ts.map +1 -0
- package/dist/commands/default-branch.d.ts +70 -0
- package/dist/commands/default-branch.d.ts.map +1 -0
- package/dist/commands/describe-command.d.ts.map +1 -1
- package/dist/commands/diff-command.d.ts +377 -30
- package/dist/commands/diff-command.d.ts.map +1 -1
- package/dist/commands/diff-textconv.d.ts +40 -0
- package/dist/commands/diff-textconv.d.ts.map +1 -0
- package/dist/commands/fetch-command.d.ts +149 -10
- package/dist/commands/fetch-command.d.ts.map +1 -1
- package/dist/commands/format-patch-command.d.ts +164 -0
- package/dist/commands/format-patch-command.d.ts.map +1 -0
- package/dist/commands/fsck/fetch-fsck.d.ts +60 -0
- package/dist/commands/fsck/fetch-fsck.d.ts.map +1 -0
- package/dist/commands/fsck/fsck-command.d.ts +227 -0
- package/dist/commands/fsck/fsck-command.d.ts.map +1 -0
- package/dist/commands/fsck/fsck-loose.d.ts +71 -0
- package/dist/commands/fsck/fsck-loose.d.ts.map +1 -0
- package/dist/commands/fsck/fsck-msg-ids.d.ts +122 -0
- package/dist/commands/fsck/fsck-msg-ids.d.ts.map +1 -0
- package/dist/commands/fsck/fsck-object-checks.d.ts +159 -0
- package/dist/commands/fsck/fsck-object-checks.d.ts.map +1 -0
- package/dist/commands/fsck/fsck-object-table.d.ts +140 -0
- package/dist/commands/fsck/fsck-object-table.d.ts.map +1 -0
- package/dist/commands/fsck/fsck-pack.d.ts +122 -0
- package/dist/commands/fsck/fsck-pack.d.ts.map +1 -0
- package/dist/commands/fsck/index.d.ts +6 -0
- package/dist/commands/fsck/index.d.ts.map +1 -0
- package/dist/commands/fsck/verify-pack-command.d.ts +81 -0
- package/dist/commands/fsck/verify-pack-command.d.ts.map +1 -0
- package/dist/commands/gc-command.d.ts +106 -39
- package/dist/commands/gc-command.d.ts.map +1 -1
- package/dist/commands/git-date.d.ts +2 -0
- package/dist/commands/git-date.d.ts.map +1 -0
- package/dist/commands/git-describe.d.ts +67 -0
- package/dist/commands/git-describe.d.ts.map +1 -0
- package/dist/commands/git-hooks.d.ts +424 -0
- package/dist/commands/git-hooks.d.ts.map +1 -0
- package/dist/commands/git-ident.d.ts +128 -0
- package/dist/commands/git-ident.d.ts.map +1 -0
- package/dist/commands/hook-command.d.ts +96 -0
- package/dist/commands/hook-command.d.ts.map +1 -0
- package/dist/commands/index-adder.d.ts +233 -0
- package/dist/commands/index-adder.d.ts.map +1 -0
- package/dist/commands/index-host.d.ts +86 -0
- package/dist/commands/index-host.d.ts.map +1 -0
- package/dist/commands/index.d.ts +56 -0
- package/dist/commands/index.d.ts.map +1 -1
- package/dist/commands/index.js +3 -2
- package/dist/commands/init-command.d.ts +62 -4
- package/dist/commands/init-command.d.ts.map +1 -1
- package/dist/commands/legacy-remotes.d.ts +55 -0
- package/dist/commands/legacy-remotes.d.ts.map +1 -0
- package/dist/commands/local-clone.d.ts +60 -0
- package/dist/commands/local-clone.d.ts.map +1 -0
- package/dist/commands/local-transport.d.ts +117 -0
- package/dist/commands/local-transport.d.ts.map +1 -0
- package/dist/commands/log-command.d.ts +216 -24
- package/dist/commands/log-command.d.ts.map +1 -1
- package/dist/commands/log-graph.d.ts +120 -0
- package/dist/commands/log-graph.d.ts.map +1 -0
- package/dist/commands/log-output.d.ts +323 -0
- package/dist/commands/log-output.d.ts.map +1 -0
- package/dist/commands/ls-remote-command.d.ts +23 -7
- package/dist/commands/ls-remote-command.d.ts.map +1 -1
- package/dist/commands/mailmap.d.ts +31 -0
- package/dist/commands/mailmap.d.ts.map +1 -0
- package/dist/commands/merge-bases.d.ts +85 -0
- package/dist/commands/merge-bases.d.ts.map +1 -0
- package/dist/commands/merge-command.d.ts +221 -74
- package/dist/commands/merge-command.d.ts.map +1 -1
- package/dist/commands/merge-config.d.ts +13 -0
- package/dist/commands/merge-config.d.ts.map +1 -0
- package/dist/commands/merge-drivers.d.ts +130 -0
- package/dist/commands/merge-drivers.d.ts.map +1 -0
- package/dist/commands/merge-support.d.ts +260 -0
- package/dist/commands/merge-support.d.ts.map +1 -0
- package/dist/commands/message-cleanup.d.ts +86 -0
- package/dist/commands/message-cleanup.d.ts.map +1 -0
- package/dist/commands/mv-command.d.ts +94 -0
- package/dist/commands/mv-command.d.ts.map +1 -0
- package/dist/commands/notes-command.d.ts +256 -0
- package/dist/commands/notes-command.d.ts.map +1 -0
- package/dist/commands/notes-commands.d.ts +41 -0
- package/dist/commands/notes-commands.d.ts.map +1 -0
- package/dist/commands/notes-merge-command.d.ts +105 -0
- package/dist/commands/notes-merge-command.d.ts.map +1 -0
- package/dist/commands/notes-support.d.ts +125 -0
- package/dist/commands/notes-support.d.ts.map +1 -0
- package/dist/commands/notes-tree.d.ts +116 -0
- package/dist/commands/notes-tree.d.ts.map +1 -0
- package/dist/commands/object-id-input.d.ts +20 -0
- package/dist/commands/object-id-input.d.ts.map +1 -0
- package/dist/commands/octopus-merge.d.ts +59 -0
- package/dist/commands/octopus-merge.d.ts.map +1 -0
- package/dist/commands/ort-merge.d.ts +126 -0
- package/dist/commands/ort-merge.d.ts.map +1 -0
- package/dist/commands/ort-recursive.d.ts +53 -0
- package/dist/commands/ort-recursive.d.ts.map +1 -0
- package/dist/commands/pack-refs-command.d.ts +20 -0
- package/dist/commands/pack-refs-command.d.ts.map +1 -1
- package/dist/commands/patch-id.d.ts +44 -0
- package/dist/commands/patch-id.d.ts.map +1 -0
- package/dist/commands/pathspec-attributes.d.ts +64 -0
- package/dist/commands/pathspec-attributes.d.ts.map +1 -0
- package/dist/commands/pathspec.d.ts +324 -0
- package/dist/commands/pathspec.d.ts.map +1 -0
- package/dist/commands/post-index-change.d.ts +33 -0
- package/dist/commands/post-index-change.d.ts.map +1 -0
- package/dist/commands/pretty-format.d.ts +222 -0
- package/dist/commands/pretty-format.d.ts.map +1 -0
- package/dist/commands/promisor-remote.d.ts +80 -0
- package/dist/commands/promisor-remote.d.ts.map +1 -0
- package/dist/commands/pull-command.d.ts +59 -8
- package/dist/commands/pull-command.d.ts.map +1 -1
- package/dist/commands/push-command.d.ts +24 -8
- package/dist/commands/push-command.d.ts.map +1 -1
- package/dist/commands/read-tree-command.d.ts +112 -0
- package/dist/commands/read-tree-command.d.ts.map +1 -0
- package/dist/commands/rebase-command.d.ts +507 -75
- package/dist/commands/rebase-command.d.ts.map +1 -1
- package/dist/commands/rebase-todo.d.ts +130 -0
- package/dist/commands/rebase-todo.d.ts.map +1 -0
- package/dist/commands/ref-decoration-filter.d.ts +53 -0
- package/dist/commands/ref-decoration-filter.d.ts.map +1 -0
- package/dist/commands/reflog-messages.d.ts +98 -0
- package/dist/commands/reflog-messages.d.ts.map +1 -0
- package/dist/commands/remote-command.d.ts +31 -0
- package/dist/commands/remote-command.d.ts.map +1 -1
- package/dist/commands/remote-transport.d.ts +120 -0
- package/dist/commands/remote-transport.d.ts.map +1 -0
- package/dist/commands/reset-command.d.ts +161 -7
- package/dist/commands/reset-command.d.ts.map +1 -1
- package/dist/commands/restore-command.d.ts +103 -0
- package/dist/commands/restore-command.d.ts.map +1 -0
- package/dist/commands/rev-list-command.d.ts +78 -0
- package/dist/commands/rev-list-command.d.ts.map +1 -0
- package/dist/commands/rev-parse-command.d.ts +89 -0
- package/dist/commands/rev-parse-command.d.ts.map +1 -0
- package/dist/commands/revert-command.d.ts +46 -38
- package/dist/commands/revert-command.d.ts.map +1 -1
- package/dist/commands/revision-filenames.d.ts +95 -0
- package/dist/commands/revision-filenames.d.ts.map +1 -0
- package/dist/commands/revision-range.d.ts +67 -0
- package/dist/commands/revision-range.d.ts.map +1 -0
- package/dist/commands/revision-resolver.d.ts +325 -0
- package/dist/commands/revision-resolver.d.ts.map +1 -0
- package/dist/commands/rm-command.d.ts +69 -7
- package/dist/commands/rm-command.d.ts.map +1 -1
- package/dist/commands/sequencer-pick.d.ts +191 -0
- package/dist/commands/sequencer-pick.d.ts.map +1 -0
- package/dist/commands/sequencer-support.d.ts +125 -0
- package/dist/commands/sequencer-support.d.ts.map +1 -0
- package/dist/commands/serve-repository.d.ts +52 -0
- package/dist/commands/serve-repository.d.ts.map +1 -0
- package/dist/commands/sparse-checkout-command.d.ts +190 -0
- package/dist/commands/sparse-checkout-command.d.ts.map +1 -0
- package/dist/commands/sparse-checkout-support.d.ts +268 -0
- package/dist/commands/sparse-checkout-support.d.ts.map +1 -0
- package/dist/commands/stash-apply-command.d.ts +42 -8
- package/dist/commands/stash-apply-command.d.ts.map +1 -1
- package/dist/commands/stash-create-command.d.ts +156 -2
- package/dist/commands/stash-create-command.d.ts.map +1 -1
- package/dist/commands/stash-drop-command.d.ts +2 -0
- package/dist/commands/stash-drop-command.d.ts.map +1 -1
- package/dist/commands/stash-working-tree.d.ts +23 -0
- package/dist/commands/stash-working-tree.d.ts.map +1 -1
- package/dist/commands/status-command.d.ts +300 -15
- package/dist/commands/status-command.d.ts.map +1 -1
- package/dist/commands/status-format.d.ts +155 -0
- package/dist/commands/status-format.d.ts.map +1 -0
- package/dist/commands/status-header.d.ts +64 -0
- package/dist/commands/status-header.d.ts.map +1 -0
- package/dist/commands/strerror.d.ts +7 -0
- package/dist/commands/strerror.d.ts.map +1 -0
- package/dist/commands/submodule-config.d.ts +38 -0
- package/dist/commands/submodule-config.d.ts.map +1 -0
- package/dist/commands/submodule-summary-command.d.ts +80 -0
- package/dist/commands/submodule-summary-command.d.ts.map +1 -0
- package/dist/commands/submodule-summary.d.ts +150 -0
- package/dist/commands/submodule-summary.d.ts.map +1 -0
- package/dist/commands/switch-command.d.ts +132 -0
- package/dist/commands/switch-command.d.ts.map +1 -0
- package/dist/commands/tag-command.d.ts +23 -2
- package/dist/commands/tag-command.d.ts.map +1 -1
- package/dist/commands/tracking-info.d.ts +64 -0
- package/dist/commands/tracking-info.d.ts.map +1 -0
- package/dist/commands/trailers.d.ts +73 -0
- package/dist/commands/trailers.d.ts.map +1 -0
- package/dist/commands/tree-restore.d.ts +85 -1
- package/dist/commands/tree-restore.d.ts.map +1 -1
- package/dist/commands/untracked-cache-support.d.ts +54 -0
- package/dist/commands/untracked-cache-support.d.ts.map +1 -0
- package/dist/commands/worktree-add-command.d.ts +108 -0
- package/dist/commands/worktree-add-command.d.ts.map +1 -0
- package/dist/commands/worktree-list-command.d.ts +69 -0
- package/dist/commands/worktree-list-command.d.ts.map +1 -0
- package/dist/commands/worktree-lock-command.d.ts +44 -0
- package/dist/commands/worktree-lock-command.d.ts.map +1 -0
- package/dist/commands/worktree-overwrite-checks.d.ts +146 -6
- package/dist/commands/worktree-overwrite-checks.d.ts.map +1 -1
- package/dist/commands/worktree-prune-command.d.ts +48 -0
- package/dist/commands/worktree-prune-command.d.ts.map +1 -0
- package/dist/commands/worktree-remove-command.d.ts +59 -0
- package/dist/commands/worktree-remove-command.d.ts.map +1 -0
- package/dist/commands/worktree-repair-command.d.ts +35 -0
- package/dist/commands/worktree-repair-command.d.ts.map +1 -0
- package/dist/commands/worktree-support.d.ts +64 -0
- package/dist/commands/worktree-support.d.ts.map +1 -0
- package/dist/commands-DIJ91NnD.js +62225 -0
- package/dist/core-commands/add.command.impl.d.ts.map +1 -1
- package/dist/errors/add-errors.d.ts +55 -0
- package/dist/errors/add-errors.d.ts.map +1 -1
- package/dist/errors/checkout-errors.d.ts +16 -0
- package/dist/errors/checkout-errors.d.ts.map +1 -1
- package/dist/errors/command-errors.d.ts +77 -0
- package/dist/errors/command-errors.d.ts.map +1 -1
- package/dist/errors/commit-errors.d.ts +9 -0
- package/dist/errors/commit-errors.d.ts.map +1 -1
- package/dist/errors/git-api-error.d.ts +59 -2
- package/dist/errors/git-api-error.d.ts.map +1 -1
- package/dist/errors/index.d.ts +1 -0
- package/dist/errors/index.d.ts.map +1 -1
- package/dist/errors/index.js +354 -19
- package/dist/errors/rebase-errors.d.ts +9 -0
- package/dist/errors/rebase-errors.d.ts.map +1 -1
- package/dist/errors/ref-errors.d.ts +32 -0
- package/dist/errors/ref-errors.d.ts.map +1 -1
- package/dist/errors/transport-errors.d.ts +12 -2
- package/dist/errors/transport-errors.d.ts.map +1 -1
- package/dist/errors/worktree-errors.d.ts +35 -0
- package/dist/errors/worktree-errors.d.ts.map +1 -0
- package/dist/git-command-BGiOJ8Zk.js +7246 -0
- package/dist/git-command.d.ts +428 -32
- package/dist/git-command.d.ts.map +1 -1
- package/dist/git.d.ts +315 -5
- package/dist/git.d.ts.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -5
- package/dist/remote-config/index.d.ts +1 -1
- package/dist/remote-config/index.d.ts.map +1 -1
- package/dist/remote-config/remote-config-store.d.ts +167 -6
- package/dist/remote-config/remote-config-store.d.ts.map +1 -1
- package/dist/remote-config/remote-refs.d.ts +7 -3
- package/dist/remote-config/remote-refs.d.ts.map +1 -1
- package/dist/rename/detect-renames.d.ts +148 -0
- package/dist/rename/detect-renames.d.ts.map +1 -0
- package/dist/rename/git-similarity.d.ts +44 -0
- package/dist/rename/git-similarity.d.ts.map +1 -0
- package/dist/rename/index.d.ts +2 -0
- package/dist/rename/index.d.ts.map +1 -1
- package/dist/results/binary-patch.d.ts +11 -0
- package/dist/results/binary-patch.d.ts.map +1 -0
- package/dist/results/blame-format.d.ts +55 -0
- package/dist/results/blame-format.d.ts.map +1 -0
- package/dist/results/cherry-pick-result.d.ts +10 -0
- package/dist/results/cherry-pick-result.d.ts.map +1 -1
- package/dist/results/clone-result.d.ts +18 -0
- package/dist/results/clone-result.d.ts.map +1 -1
- package/dist/results/combined-diff.d.ts +77 -0
- package/dist/results/combined-diff.d.ts.map +1 -0
- package/dist/results/diff-entry.d.ts +32 -0
- package/dist/results/diff-entry.d.ts.map +1 -1
- package/dist/results/diff-formatter.d.ts +34 -60
- package/dist/results/diff-formatter.d.ts.map +1 -1
- package/dist/results/diff-order.d.ts +25 -0
- package/dist/results/diff-order.d.ts.map +1 -0
- package/dist/results/diff-output.d.ts +249 -0
- package/dist/results/diff-output.d.ts.map +1 -0
- package/dist/results/fetch-result.d.ts +15 -0
- package/dist/results/fetch-result.d.ts.map +1 -1
- package/dist/results/index.d.ts +5 -0
- package/dist/results/index.d.ts.map +1 -1
- package/dist/results/index.js +2 -252
- package/dist/results/init-result.d.ts +7 -0
- package/dist/results/init-result.d.ts.map +1 -1
- package/dist/results/merge-result.d.ts +15 -1
- package/dist/results/merge-result.d.ts.map +1 -1
- package/dist/results/pull-result.d.ts +17 -3
- package/dist/results/pull-result.d.ts.map +1 -1
- package/dist/results/push-result.d.ts +47 -0
- package/dist/results/push-result.d.ts.map +1 -1
- package/dist/results/quote-path.d.ts +27 -0
- package/dist/results/quote-path.d.ts.map +1 -0
- package/dist/results/rebase-result.d.ts +28 -1
- package/dist/results/rebase-result.d.ts.map +1 -1
- package/dist/results/revert-result.d.ts +10 -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 +60 -6
- package/dist/results/status-result.d.ts.map +1 -1
- package/dist/results-WVlBhVb1.js +2935 -0
- package/dist/transport-command.d.ts +44 -1
- package/dist/transport-command.d.ts.map +1 -1
- package/package.json +15 -11
- package/src/commands/add-command.ts +1291 -226
- package/src/commands/add-patch/add-interactive.ts +941 -0
- package/src/commands/add-patch/add-patch.ts +1169 -0
- package/src/commands/add-patch/index.ts +5 -0
- package/src/commands/add-patch/patch-backend.ts +239 -0
- package/src/commands/add-patch/patch-modes.ts +249 -0
- package/src/commands/add-patch/patch-session.ts +159 -0
- package/src/commands/am/am-command.ts +1111 -0
- package/src/commands/am/index.ts +2 -0
- package/src/commands/am/mailinfo.ts +1015 -0
- package/src/commands/am/patch-format.ts +121 -0
- package/src/commands/apply/apply-command.ts +842 -0
- package/src/commands/apply/apply-engine.ts +1602 -0
- package/src/commands/apply/apply-parse.ts +1210 -0
- package/src/commands/apply/apply-types.ts +112 -0
- package/src/commands/apply/index.ts +5 -0
- package/src/commands/apply/latin1.ts +171 -0
- package/src/commands/apply/whitespace.ts +260 -0
- package/src/commands/attributes-source.ts +96 -0
- package/src/commands/backfill-command.ts +694 -0
- package/src/commands/bisect/bisect-checkout.ts +217 -0
- package/src/commands/bisect/bisect-command.ts +788 -0
- package/src/commands/bisect/bisect-engine.ts +1080 -0
- package/src/commands/bisect/bisect-graph.ts +595 -0
- package/src/commands/bisect/bisect-quote.ts +92 -0
- package/src/commands/bisect/index.ts +4 -0
- package/src/commands/blame-command.ts +711 -986
- package/src/commands/branch-command.ts +354 -32
- package/src/commands/branch-tracking.ts +331 -0
- package/src/commands/checkout-command.ts +1290 -243
- package/src/commands/checkout-paths.ts +784 -0
- package/src/commands/cherry-pick-command.ts +156 -396
- package/src/commands/clean-command.ts +504 -156
- package/src/commands/clone-command.ts +748 -69
- package/src/commands/comment-char-config.ts +160 -0
- package/src/commands/commit-command.ts +1782 -166
- package/src/commands/core-config.ts +166 -6
- package/src/commands/date-format.ts +668 -0
- package/src/commands/default-branch.ts +196 -0
- package/src/commands/describe-command.ts +2 -0
- package/src/commands/diff-command.ts +1916 -110
- package/src/commands/diff-textconv.ts +50 -0
- package/src/commands/fetch-command.ts +622 -68
- package/src/commands/format-patch-command.ts +974 -0
- package/src/commands/fsck/fetch-fsck.ts +229 -0
- package/src/commands/fsck/fsck-command.ts +3464 -0
- package/src/commands/fsck/fsck-loose.ts +297 -0
- package/src/commands/fsck/fsck-msg-ids.ts +176 -0
- package/src/commands/fsck/fsck-object-checks.ts +1085 -0
- package/src/commands/fsck/fsck-object-table.ts +373 -0
- package/src/commands/fsck/fsck-pack.ts +634 -0
- package/src/commands/fsck/index.ts +5 -0
- package/src/commands/fsck/verify-pack-command.ts +252 -0
- package/src/commands/gc-command.ts +324 -77
- package/src/commands/git-date.ts +9 -0
- package/src/commands/git-describe.ts +316 -0
- package/src/commands/git-hooks.ts +1483 -0
- package/src/commands/git-ident.ts +344 -0
- package/src/commands/hook-command.ts +247 -0
- package/src/commands/index-adder.ts +711 -0
- package/src/commands/index-host.ts +291 -0
- package/src/commands/index.ts +84 -0
- package/src/commands/init-command.ts +194 -14
- package/src/commands/legacy-remotes.ts +224 -0
- package/src/commands/local-clone.ts +183 -0
- package/src/commands/local-transport.ts +762 -0
- package/src/commands/log-command.ts +1930 -170
- package/src/commands/log-graph.ts +671 -0
- package/src/commands/log-output.ts +1359 -0
- package/src/commands/ls-remote-command.ts +105 -58
- package/src/commands/mailmap.ts +129 -0
- package/src/commands/merge-bases.ts +296 -0
- package/src/commands/merge-command.ts +1416 -491
- package/src/commands/merge-config.ts +25 -0
- package/src/commands/merge-drivers.ts +306 -0
- package/src/commands/merge-support.ts +1219 -0
- package/src/commands/message-cleanup.ts +275 -0
- package/src/commands/mv-command.ts +976 -0
- package/src/commands/notes-command.ts +890 -0
- package/src/commands/notes-commands.ts +87 -0
- package/src/commands/notes-merge-command.ts +777 -0
- package/src/commands/notes-support.ts +402 -0
- package/src/commands/notes-tree.ts +617 -0
- package/src/commands/object-id-input.ts +27 -0
- package/src/commands/octopus-merge.ts +378 -0
- package/src/commands/ort-merge.ts +1660 -0
- package/src/commands/ort-recursive.ts +160 -0
- package/src/commands/pack-refs-command.ts +39 -22
- package/src/commands/patch-id.ts +204 -0
- package/src/commands/pathspec-attributes.ts +162 -0
- package/src/commands/pathspec.ts +1199 -0
- package/src/commands/post-index-change.ts +62 -0
- package/src/commands/pretty-format.ts +1432 -0
- package/src/commands/promisor-remote.ts +298 -0
- package/src/commands/pull-command.ts +326 -33
- package/src/commands/push-command.ts +257 -29
- package/src/commands/read-tree-command.ts +861 -0
- package/src/commands/rebase-command.ts +3820 -372
- package/src/commands/rebase-todo.ts +584 -0
- package/src/commands/ref-decoration-filter.ts +118 -0
- package/src/commands/reflog-messages.ts +177 -0
- package/src/commands/remote-command.ts +124 -23
- package/src/commands/remote-transport.ts +383 -0
- package/src/commands/reset-command.ts +821 -104
- package/src/commands/restore-command.ts +350 -0
- package/src/commands/rev-list-command.ts +167 -0
- package/src/commands/rev-parse-command.ts +299 -0
- package/src/commands/revert-command.ts +152 -399
- package/src/commands/revision-filenames.ts +254 -0
- package/src/commands/revision-range.ts +222 -0
- package/src/commands/revision-resolver.ts +1397 -0
- package/src/commands/rm-command.ts +613 -67
- package/src/commands/sequencer-pick.ts +874 -0
- package/src/commands/sequencer-support.ts +876 -0
- package/src/commands/serve-repository.ts +125 -0
- package/src/commands/sparse-checkout-command.ts +1389 -0
- package/src/commands/sparse-checkout-support.ts +793 -0
- package/src/commands/stash-apply-command.ts +376 -343
- package/src/commands/stash-create-command.ts +625 -42
- package/src/commands/stash-drop-command.ts +15 -2
- package/src/commands/stash-working-tree.ts +168 -24
- package/src/commands/status-command.ts +1326 -105
- package/src/commands/status-format.ts +775 -0
- package/src/commands/status-header.ts +332 -0
- package/src/commands/strerror.ts +29 -0
- package/src/commands/submodule-config.ts +94 -0
- package/src/commands/submodule-summary-command.ts +333 -0
- package/src/commands/submodule-summary.ts +446 -0
- package/src/commands/switch-command.ts +402 -0
- package/src/commands/tag-command.ts +129 -41
- package/src/commands/tracking-info.ts +201 -0
- package/src/commands/trailers.ts +417 -0
- package/src/commands/tree-restore.ts +204 -4
- package/src/commands/untracked-cache-support.ts +198 -0
- package/src/commands/worktree-add-command.ts +458 -0
- package/src/commands/worktree-list-command.ts +206 -0
- package/src/commands/worktree-lock-command.ts +96 -0
- package/src/commands/worktree-overwrite-checks.ts +452 -26
- package/src/commands/worktree-prune-command.ts +99 -0
- package/src/commands/worktree-remove-command.ts +186 -0
- package/src/commands/worktree-repair-command.ts +59 -0
- package/src/commands/worktree-support.ts +214 -0
- package/src/core-commands/add.command.impl.ts +8 -2
- package/src/errors/add-errors.ts +45 -0
- package/src/errors/checkout-errors.ts +26 -2
- package/src/errors/command-errors.ts +101 -1
- package/src/errors/commit-errors.ts +18 -2
- package/src/errors/git-api-error.ts +82 -2
- package/src/errors/index.ts +1 -0
- package/src/errors/merge-errors.ts +2 -2
- package/src/errors/rebase-errors.ts +12 -0
- package/src/errors/ref-errors.ts +56 -2
- package/src/errors/remote-errors.ts +2 -2
- package/src/errors/stash-errors.ts +1 -1
- package/src/errors/transport-errors.ts +20 -4
- package/src/errors/worktree-errors.ts +49 -0
- package/src/git-command.ts +1207 -118
- package/src/git.ts +538 -12
- package/src/index.ts +1 -1
- package/src/remote-config/index.ts +2 -0
- package/src/remote-config/remote-config-store.ts +378 -18
- package/src/remote-config/remote-refs.ts +22 -6
- package/src/rename/detect-renames.ts +715 -0
- package/src/rename/git-similarity.ts +116 -0
- package/src/rename/index.ts +2 -0
- package/src/results/binary-patch.ts +401 -0
- package/src/results/blame-format.ts +239 -0
- package/src/results/cherry-pick-result.ts +10 -0
- package/src/results/clone-result.ts +21 -0
- package/src/results/combined-diff.ts +585 -0
- package/src/results/diff-entry.ts +35 -0
- package/src/results/diff-formatter.ts +152 -288
- package/src/results/diff-order.ts +64 -0
- package/src/results/diff-output.ts +1053 -0
- package/src/results/fetch-result.ts +15 -0
- package/src/results/index.ts +5 -0
- package/src/results/init-result.ts +9 -0
- package/src/results/merge-result.ts +15 -1
- package/src/results/pull-result.ts +17 -3
- package/src/results/push-result.ts +48 -0
- package/src/results/quote-path.ts +103 -0
- package/src/results/rebase-result.ts +37 -0
- package/src/results/revert-result.ts +10 -0
- package/src/results/stash-result.ts +6 -0
- package/src/results/status-result.ts +127 -46
- package/src/transport-command.ts +121 -2
- package/dist/commands-CsLNyvZ1.js +0 -12587
- package/dist/status-result-BpyUK1Sg.js +0 -519
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"patch-format.d.ts","sourceRoot":"","sources":["../../../src/commands/am/patch-format.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,wDAAwD;AACxD,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,GAAG,cAAc,GAAG,IAAI,CAAC;AA2BhF;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,aAAa,GAAG,SAAS,CAa5E;AAkBD,uDAAuD;AACvD,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAgBtD;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,CA0BjF"}
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `git apply`: applies patches (git diffs, unified diffs, binary patches) to the worktree,
|
|
3
|
+
* the index (`--index`) or the index alone (`--cached`), or only reports on them
|
|
4
|
+
* (`--check`, `--stat`, `--numstat`, `--summary`), with git's messages byte for byte.
|
|
5
|
+
*/
|
|
6
|
+
import { GitCommand } from "../../git-command.js";
|
|
7
|
+
import { type ApplyIndexEntry } from "./apply-engine.js";
|
|
8
|
+
import { type WsErrorAction } from "./apply-types.js";
|
|
9
|
+
/** What `git apply` printed and how it ended. */
|
|
10
|
+
export interface ApplyResult {
|
|
11
|
+
/** git's exit status: 0 applied, 1 not (or not cleanly), 128 fatal */
|
|
12
|
+
exitCode: number;
|
|
13
|
+
/** Standard output (`--stat`, `--numstat`, `--summary`) */
|
|
14
|
+
output: string;
|
|
15
|
+
/** Standard error: errors, warnings, verbose messages */
|
|
16
|
+
errors: string;
|
|
17
|
+
/** Paths left with conflicts by `--3way` */
|
|
18
|
+
conflicts: string[];
|
|
19
|
+
/** With {@link ApplyCommand.setTemporaryIndex}: that index after the patches */
|
|
20
|
+
index?: Map<string, {
|
|
21
|
+
mode: number;
|
|
22
|
+
objectId: string;
|
|
23
|
+
}>;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Applies patches as `git apply` does.
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```typescript
|
|
30
|
+
* const { exitCode, errors } = await git.apply().addPatch(diffBytes).setIndex(true).call();
|
|
31
|
+
* const { output } = await git.apply().addPatch(diffBytes).setStat(true).call();
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
export declare class ApplyCommand extends GitCommand<ApplyResult> {
|
|
35
|
+
private patches;
|
|
36
|
+
private index;
|
|
37
|
+
private cached;
|
|
38
|
+
private check;
|
|
39
|
+
private stat;
|
|
40
|
+
private numstat;
|
|
41
|
+
private summary;
|
|
42
|
+
private forceApply;
|
|
43
|
+
private reverse;
|
|
44
|
+
private threeWay;
|
|
45
|
+
private reject;
|
|
46
|
+
private unidiffZero;
|
|
47
|
+
private recount;
|
|
48
|
+
private inaccurateEof;
|
|
49
|
+
private allowEmpty;
|
|
50
|
+
private allowOverlap;
|
|
51
|
+
private noAdd;
|
|
52
|
+
private unsafePaths;
|
|
53
|
+
private intentToAdd;
|
|
54
|
+
private nul;
|
|
55
|
+
private whitespace;
|
|
56
|
+
private ignoreWhitespace?;
|
|
57
|
+
private context?;
|
|
58
|
+
private strip?;
|
|
59
|
+
private directory?;
|
|
60
|
+
private limits;
|
|
61
|
+
private verbosity;
|
|
62
|
+
private mergeVariant?;
|
|
63
|
+
private legacyMessages;
|
|
64
|
+
private temporaryIndex?;
|
|
65
|
+
/**
|
|
66
|
+
* Adds a patch. `name` is the patch file's name as git shows it in messages (the file
|
|
67
|
+
* argument); without it the patch reads as standard input (`<stdin>`).
|
|
68
|
+
*/
|
|
69
|
+
addPatch(patch: Uint8Array | string, name?: string): this;
|
|
70
|
+
/** `--index`: apply to the index and the worktree, which must match it. */
|
|
71
|
+
setIndex(value: boolean): this;
|
|
72
|
+
/** `--cached`: apply to the index only. */
|
|
73
|
+
setCached(value: boolean): this;
|
|
74
|
+
/** `--check`: only see whether the patches apply. */
|
|
75
|
+
setCheck(value: boolean): this;
|
|
76
|
+
/** `--stat`: print a diffstat instead of applying. */
|
|
77
|
+
setStat(value: boolean): this;
|
|
78
|
+
/** `--numstat`. */
|
|
79
|
+
setNumstat(value: boolean): this;
|
|
80
|
+
/** `--summary`. */
|
|
81
|
+
setSummary(value: boolean): this;
|
|
82
|
+
/** `--apply`: apply even with `--stat`, `--numstat`, `--summary` or `--check`. */
|
|
83
|
+
setApply(value: boolean): this;
|
|
84
|
+
/** `-R`: apply in reverse. */
|
|
85
|
+
setReverse(value: boolean): this;
|
|
86
|
+
/** `--3way`: fall back to a three-way merge with the blobs the patch names. */
|
|
87
|
+
setThreeWay(value: boolean): this;
|
|
88
|
+
/** `--ours`, `--theirs`, `--union` with `--3way`. */
|
|
89
|
+
setMergeVariant(variant: "ours" | "theirs" | "union" | undefined): this;
|
|
90
|
+
/** `--reject`: apply what applies, leave the rest in `<file>.rej`. */
|
|
91
|
+
setReject(value: boolean): this;
|
|
92
|
+
/** `--unidiff-zero`. */
|
|
93
|
+
setUnidiffZero(value: boolean): this;
|
|
94
|
+
/** `--recount`. */
|
|
95
|
+
setRecount(value: boolean): this;
|
|
96
|
+
/** `--inaccurate-eof`. */
|
|
97
|
+
setInaccurateEof(value: boolean): this;
|
|
98
|
+
/** `--allow-empty`. */
|
|
99
|
+
setAllowEmpty(value: boolean): this;
|
|
100
|
+
/** `--allow-overlap`. */
|
|
101
|
+
setAllowOverlap(value: boolean): this;
|
|
102
|
+
/** `--no-add`. */
|
|
103
|
+
setNoAdd(value: boolean): this;
|
|
104
|
+
/** `--unsafe-paths`. */
|
|
105
|
+
setUnsafePaths(value: boolean): this;
|
|
106
|
+
/** `-N` / `--intent-to-add`. */
|
|
107
|
+
setIntentToAdd(value: boolean): this;
|
|
108
|
+
/** `-z`: `--numstat` names unquoted and NUL-terminated. */
|
|
109
|
+
setNul(value: boolean): this;
|
|
110
|
+
/**
|
|
111
|
+
* `--whitespace=<action>`: nowarn, warn, fix (strip), error, error-all. As with git's
|
|
112
|
+
* repeated option, the last action wins, but an `error-all` before it still reports
|
|
113
|
+
* every whitespace error.
|
|
114
|
+
*/
|
|
115
|
+
setWhitespace(action: string): this;
|
|
116
|
+
/** `--ignore-whitespace` / `--ignore-space-change`. */
|
|
117
|
+
setIgnoreWhitespace(value: boolean): this;
|
|
118
|
+
/** `-C<n>`: at least this many context lines must match. */
|
|
119
|
+
setContext(lines: number): this;
|
|
120
|
+
/** `-p<n>`: leading path components to strip (default 1). */
|
|
121
|
+
setStrip(n: number): this;
|
|
122
|
+
/** `--directory=<root>`: prepend to every path. */
|
|
123
|
+
setDirectory(root: string): this;
|
|
124
|
+
/** `--include=<glob>`. */
|
|
125
|
+
addInclude(pattern: string): this;
|
|
126
|
+
/** `--exclude=<glob>`. */
|
|
127
|
+
addExclude(pattern: string): this;
|
|
128
|
+
/** `-v` (true) / `-q` (false) / normal (undefined). */
|
|
129
|
+
setVerbose(verbose: boolean | undefined): this;
|
|
130
|
+
/**
|
|
131
|
+
* Messages as git before 2.46 words them ("corrupt patch at line 5" instead of
|
|
132
|
+
* "corrupt patch at <stdin>:5").
|
|
133
|
+
*/
|
|
134
|
+
setLegacyMessages(value: boolean): this;
|
|
135
|
+
/**
|
|
136
|
+
* Applies to this index instead of the repository's (`--cached` with git's
|
|
137
|
+
* `index_file`, as `git am --3way` applies to its fake ancestor); the result has it.
|
|
138
|
+
*/
|
|
139
|
+
setTemporaryIndex(index: Map<string, {
|
|
140
|
+
mode: number;
|
|
141
|
+
objectId: string;
|
|
142
|
+
}>): this;
|
|
143
|
+
call(): Promise<ApplyResult>;
|
|
144
|
+
private run;
|
|
145
|
+
private makeIO;
|
|
146
|
+
}
|
|
147
|
+
/** `parse_whitespace_option`. */
|
|
148
|
+
export declare function parseWhitespaceAction(option: string | undefined): {
|
|
149
|
+
action: WsErrorAction;
|
|
150
|
+
all?: boolean;
|
|
151
|
+
} | undefined;
|
|
152
|
+
export type { ApplyIndexEntry };
|
|
153
|
+
//# sourceMappingURL=apply-command.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apply-command.d.ts","sourceRoot":"","sources":["../../../src/commands/apply/apply-command.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAaH,O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B,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,CAGtC;IAED;;;OAGG;IACH,iBAAiB,CAAC,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC,GAAG,IAAI,CAI9E;IAEK,IAAI,IAAI,OAAO,CAAC,WAAW,CAAC,CAkBjC;YAEa,GAAG;IAkNjB,OAAO,CAAC,MAAM;CA+Qf;AAED,iCAAiC;AACjC,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,MAAM,GAAG,SAAS,GACzB;IAAE,MAAM,EAAE,aAAa,CAAC;IAAC,GAAG,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,SAAS,CAOtD;AAiBD,YAAY,EAAE,eAAe,EAAE,CAAC"}
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The applier of `git apply` (apply.c): finds where each hunk applies (offsets, context
|
|
3
|
+
* reduction, whitespace fuzz), applies binary patches, checks the preimage against the
|
|
4
|
+
* worktree and the index, falls back to a three-way merge, and writes the results, the
|
|
5
|
+
* rejects and the index. The storage it works on is behind {@link ApplyIO}.
|
|
6
|
+
*/
|
|
7
|
+
import { ApplyParser } from "./apply-parse.js";
|
|
8
|
+
import { type FilePatch } from "./apply-types.js";
|
|
9
|
+
import { cQuote } from "./latin1.js";
|
|
10
|
+
/** An index entry as the applier sees it (stage 0 unless said otherwise). */
|
|
11
|
+
export interface ApplyIndexEntry {
|
|
12
|
+
mode: number;
|
|
13
|
+
oid: string;
|
|
14
|
+
intentToAdd?: boolean;
|
|
15
|
+
stage?: number;
|
|
16
|
+
}
|
|
17
|
+
/** The storage `git apply` reads and writes; names are binary strings. */
|
|
18
|
+
export interface ApplyIO {
|
|
19
|
+
/** lstat of a worktree path: its mode (S_IFREG|perm, S_IFLNK, S_IFDIR), none when absent */
|
|
20
|
+
lstat(name: string): Promise<{
|
|
21
|
+
mode: number;
|
|
22
|
+
} | undefined>;
|
|
23
|
+
/**
|
|
24
|
+
* The worktree file's content as git would stage it (a link: its target); `keepCrlf`
|
|
25
|
+
* skips the line-ending conversion (`CONV_EOL_KEEP_CRLF`), otherwise CRLF in the index
|
|
26
|
+
* does not hold it back (`CONV_EOL_RENORMALIZE`)
|
|
27
|
+
*/
|
|
28
|
+
readWorktree(name: string, mode: number, keepCrlf: boolean): Promise<string | undefined>;
|
|
29
|
+
/**
|
|
30
|
+
* Why lstat of a missing worktree path fails, as strerror (`ENOTDIR` when a leading path
|
|
31
|
+
* is a file); "No such file or directory" when not given
|
|
32
|
+
*/
|
|
33
|
+
missingReason?(name: string): Promise<string>;
|
|
34
|
+
/** Whether a leading directory of the path is a symlink in the worktree */
|
|
35
|
+
hasSymlinkLeadingPath(name: string): Promise<boolean>;
|
|
36
|
+
/** The mode git would stage for the worktree file (`ce_mode_from_stat`) */
|
|
37
|
+
modeFromStat(name: string, entry: ApplyIndexEntry | undefined, stMode: number): number;
|
|
38
|
+
/** Whether the worktree file still matches the index entry (`ie_match_stat`) */
|
|
39
|
+
matchesIndex(name: string, entry: ApplyIndexEntry): Promise<boolean>;
|
|
40
|
+
/** Checks the entry out to the worktree (`checkout_target`); false on failure */
|
|
41
|
+
checkout(name: string, entry: ApplyIndexEntry): Promise<boolean>;
|
|
42
|
+
readBlob(oid: string): Promise<string | undefined>;
|
|
43
|
+
hasObject(oid: string): Promise<boolean>;
|
|
44
|
+
writeBlob(content: string): Promise<string>;
|
|
45
|
+
hashBlob(content: string): Promise<string>;
|
|
46
|
+
/** The blob a (possibly abbreviated) id names */
|
|
47
|
+
resolveBlob(prefix: string): Promise<string | undefined>;
|
|
48
|
+
/** `ll_merge` of three blobs; conflicts > 0 for a conflicted result, undefined on failure */
|
|
49
|
+
merge(name: string, base: string, ours: string, theirs: string, variant: "ours" | "theirs" | "union" | undefined): Promise<{
|
|
50
|
+
content: string;
|
|
51
|
+
conflicts: number;
|
|
52
|
+
binary?: boolean;
|
|
53
|
+
} | undefined>;
|
|
54
|
+
/**
|
|
55
|
+
* Removes a worktree file (a gitlink: its directory when empty) and, with `rmdirEmpty`,
|
|
56
|
+
* the directories it leaves empty (`remove_or_warn`, `remove_path`); a warning on failure
|
|
57
|
+
*/
|
|
58
|
+
removeWorktree(name: string, mode: number, rmdirEmpty: boolean): Promise<string | undefined>;
|
|
59
|
+
/** Writes a worktree file (smudged), creating directories; an error message on failure */
|
|
60
|
+
createWorktree(name: string, mode: number, content: string): Promise<string | undefined>;
|
|
61
|
+
writeReject(name: string, content: string): Promise<void>;
|
|
62
|
+
/** Stat data of a written file for its index entry */
|
|
63
|
+
statOf(name: string): Promise<Record<string, number> | undefined>;
|
|
64
|
+
/** Whether symlinks can be created (`core.symlinks`) */
|
|
65
|
+
hasSymlinks: boolean;
|
|
66
|
+
trustExecutableBit: boolean;
|
|
67
|
+
/** Whether the path is safe to have in the index (`verify_path`) */
|
|
68
|
+
verifyPath(name: string, mode: number): boolean;
|
|
69
|
+
}
|
|
70
|
+
/** Options of {@link ApplyEngine.applyAll}. */
|
|
71
|
+
export interface ApplyInput {
|
|
72
|
+
/** The patch bytes as a binary string */
|
|
73
|
+
text: string;
|
|
74
|
+
/** Its name in messages: the file name, `<stdin>` by default */
|
|
75
|
+
name: string;
|
|
76
|
+
/** Whether it was named on the command line (whitespace default mode per file) */
|
|
77
|
+
fromFile: boolean;
|
|
78
|
+
}
|
|
79
|
+
/** One applier run (apply.c's `apply_state` plus the patch list). */
|
|
80
|
+
export declare class ApplyEngine extends ApplyParser {
|
|
81
|
+
private readonly io;
|
|
82
|
+
private readonly indexOf;
|
|
83
|
+
private readonly wsRuleOfName;
|
|
84
|
+
private readonly wildmatch;
|
|
85
|
+
/** The names of the stage-0 index entries (for the file/directory checks) */
|
|
86
|
+
private readonly indexNames;
|
|
87
|
+
threeway: boolean;
|
|
88
|
+
cached: boolean;
|
|
89
|
+
checkIndex: boolean;
|
|
90
|
+
updateIndex: boolean;
|
|
91
|
+
itaOnly: boolean;
|
|
92
|
+
unsafePaths: boolean;
|
|
93
|
+
applyWithReject: boolean;
|
|
94
|
+
allowOverlap: boolean;
|
|
95
|
+
noAdd: boolean;
|
|
96
|
+
unidiffZero: boolean;
|
|
97
|
+
inaccurateEof: boolean;
|
|
98
|
+
recount: boolean;
|
|
99
|
+
allowEmpty: boolean;
|
|
100
|
+
diffstat: boolean;
|
|
101
|
+
numstat: boolean;
|
|
102
|
+
summary: boolean;
|
|
103
|
+
lineTermination: string;
|
|
104
|
+
pContext: number;
|
|
105
|
+
wsIgnoreChange: boolean;
|
|
106
|
+
whitespaceOptionGiven: boolean;
|
|
107
|
+
configWhitespace?: string;
|
|
108
|
+
mergeVariant?: "ours" | "theirs" | "union";
|
|
109
|
+
appliedAfterFixingWs: number;
|
|
110
|
+
maxChange: number;
|
|
111
|
+
maxLen: number;
|
|
112
|
+
/** Paths of the patch list written with conflicts, for the caller (am) */
|
|
113
|
+
conflictedPaths: string[];
|
|
114
|
+
private fnTable;
|
|
115
|
+
private removedSymlinks;
|
|
116
|
+
private keptSymlinks;
|
|
117
|
+
/** Index changes: a name's entries (all stages) replaced, or removed (empty list) */
|
|
118
|
+
readonly indexChanges: Map<string, (ApplyIndexEntry & {
|
|
119
|
+
stat?: Record<string, number>;
|
|
120
|
+
})[]>;
|
|
121
|
+
constructor(io: ApplyIO, indexOf: (name: string) => ApplyIndexEntry | undefined, wsRuleOfName: (name: string) => Promise<number>, wildmatch: (pattern: string, text: string) => boolean,
|
|
122
|
+
/** The names of the stage-0 index entries (for the file/directory checks) */
|
|
123
|
+
indexNames?: () => Iterable<string>);
|
|
124
|
+
private sortedIndexNames?;
|
|
125
|
+
/** Whether the name is an entry of the index as changed so far (at the stage). */
|
|
126
|
+
private hasIndexName;
|
|
127
|
+
/**
|
|
128
|
+
* `check_file_directory_conflict` of `add_index_entry` without `ADD_CACHE_OK_TO_REPLACE`:
|
|
129
|
+
* whether an entry (at the stage) of the index as changed so far is below the name
|
|
130
|
+
* (`has_file_name`) or one of its leading directories (`has_dir_name`).
|
|
131
|
+
*/
|
|
132
|
+
private fileDirectoryConflict;
|
|
133
|
+
/** `add_index_entry(..., ADD_CACHE_OK_TO_ADD)` of entries at one name; 0 or -1. */
|
|
134
|
+
private addIndexEntries;
|
|
135
|
+
private indexEntry;
|
|
136
|
+
private updatePrePostImages;
|
|
137
|
+
private lineByLineFuzzyMatch;
|
|
138
|
+
private matchFragment;
|
|
139
|
+
private findPos;
|
|
140
|
+
private updateImage;
|
|
141
|
+
private applyOneFragment;
|
|
142
|
+
private applyBinaryFragment;
|
|
143
|
+
private applyBinary;
|
|
144
|
+
private applyFragments;
|
|
145
|
+
private readBlobObject;
|
|
146
|
+
private addToFnTable;
|
|
147
|
+
private prepareFnTable;
|
|
148
|
+
private previousPatch;
|
|
149
|
+
/** `load_patch_target`: 0, 1 for a submodule patch without the index, -1 on error. */
|
|
150
|
+
private loadPatchTarget;
|
|
151
|
+
private loadPreimage;
|
|
152
|
+
private loadCurrent;
|
|
153
|
+
private tryThreeway;
|
|
154
|
+
private applyData;
|
|
155
|
+
private checkPreimage;
|
|
156
|
+
/** `check_to_create`: 0, 1 in index, 2 in worktree, 3 in index as ITA. */
|
|
157
|
+
private checkToCreate;
|
|
158
|
+
private prepareSymlinkChanges;
|
|
159
|
+
private pathIsBeyondSymlink;
|
|
160
|
+
private checkUnsafePath;
|
|
161
|
+
private checkPatch;
|
|
162
|
+
private sayPatchName;
|
|
163
|
+
private checkPatchList;
|
|
164
|
+
private showStats;
|
|
165
|
+
private statPatchList;
|
|
166
|
+
private numstatPatchList;
|
|
167
|
+
private summaryPatchList;
|
|
168
|
+
private patchStats;
|
|
169
|
+
private setIndex;
|
|
170
|
+
private removeFile;
|
|
171
|
+
private addIndexFile;
|
|
172
|
+
private createFile;
|
|
173
|
+
private writeOutOneResult;
|
|
174
|
+
private writeOutOneReject;
|
|
175
|
+
private writeOutResults;
|
|
176
|
+
/** `apply_patch` of one input: -128 fatal, -1 not applied, 0 applied, 1 applied partly. */
|
|
177
|
+
applyPatch(input: ApplyInput): Promise<number>;
|
|
178
|
+
/**
|
|
179
|
+
* The file patches of an input, parsed only (what `--build-fake-ancestor` reads); a
|
|
180
|
+
* negative status when the input does not parse.
|
|
181
|
+
*/
|
|
182
|
+
parsePatches(input: ApplyInput): Promise<FilePatch[] | number>;
|
|
183
|
+
/** The whitespace action when none was asked for (`set_default_whitespace_mode`). */
|
|
184
|
+
setDefaultWhitespaceMode(): void;
|
|
185
|
+
/**
|
|
186
|
+
* `apply_all_patches`: applies each input; the exit status (0, 1, 128). `wroteIndex` says
|
|
187
|
+
* whether the caller must write the index changes.
|
|
188
|
+
*/
|
|
189
|
+
applyAll(inputs: ApplyInput[]): Promise<{
|
|
190
|
+
status: number;
|
|
191
|
+
writeIndex: boolean;
|
|
192
|
+
}>;
|
|
193
|
+
}
|
|
194
|
+
export { cQuote };
|
|
195
|
+
//# sourceMappingURL=apply-engine.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apply-engine.d.ts","sourceRoot":"","sources":["../../../src/commands/apply/apply-engine.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,EAAE,WAAW,EAAW,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAGL,KAAK,SAAS,EAOf,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAiB,MAAM,EAAiB,MAAM,aAAa,CAAC;AAsMnE,6EAA6E;AAC7E,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,0EAA0E;AAC1E,MAAM,WAAW,OAAO;IACtB,4FAA4F;IAC5F,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,GAAG,SAAS,CAAC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O,CAAC;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,OAAO,CAAA;KAAE,CAAC,CAqCrF;CACF;AAoCD,OAAO,EAAE,MAAM,EAAE,CAAC"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The patch reader of `git apply` (apply.c): finds each file's header (git diffs with their
|
|
3
|
+
* extended headers, or traditional `---`/`+++` pairs), its hunks and binary hunks, and
|
|
4
|
+
* records whitespace errors on the lines it adds. A port of git's parser: what it accepts,
|
|
5
|
+
* guesses and complains about (with git's messages) follows apply.c line by line.
|
|
6
|
+
*/
|
|
7
|
+
import { type FilePatch, type WsErrorAction } from "./apply-types.js";
|
|
8
|
+
import { latin1ToBytes } from "./latin1.js";
|
|
9
|
+
/** Verbosity: -1 quiet, 0 normal, 1 verbose. */
|
|
10
|
+
export type ApplyVerbosity = -1 | 0 | 1;
|
|
11
|
+
/** `linelen`: bytes up to and including the next LF, at most `size`. */
|
|
12
|
+
export declare function linelen(buf: string, at: number, size: number): number;
|
|
13
|
+
/** Options and state the reader shares with the applier (apply.c's `apply_state`). */
|
|
14
|
+
export declare class ApplyParser {
|
|
15
|
+
root: string;
|
|
16
|
+
pValue: number;
|
|
17
|
+
pValueKnown: boolean;
|
|
18
|
+
linenr: number;
|
|
19
|
+
patchInputFile: string;
|
|
20
|
+
/** git before 2.46 named lines without the patch file ("corrupt patch at line 5") */
|
|
21
|
+
legacyMessages: boolean;
|
|
22
|
+
applyInReverse: boolean;
|
|
23
|
+
wsErrorAction: WsErrorAction;
|
|
24
|
+
squelchWhitespaceErrors: number;
|
|
25
|
+
whitespaceError: number;
|
|
26
|
+
verbosity: ApplyVerbosity;
|
|
27
|
+
apply: boolean;
|
|
28
|
+
check: boolean;
|
|
29
|
+
limitByName: {
|
|
30
|
+
pattern: string;
|
|
31
|
+
include: boolean;
|
|
32
|
+
}[];
|
|
33
|
+
hasInclude: boolean;
|
|
34
|
+
quotePathFully: boolean;
|
|
35
|
+
stderr: string;
|
|
36
|
+
stdout: string;
|
|
37
|
+
error(message: string): number;
|
|
38
|
+
warning(message: string): void;
|
|
39
|
+
/**
|
|
40
|
+
* `inflate_it`: the data inflated into exactly `size` bytes, undefined otherwise; a
|
|
41
|
+
* corrupt stream reports zlib's error as `git_inflate` does.
|
|
42
|
+
*/
|
|
43
|
+
private inflateIt;
|
|
44
|
+
/** "at <file>:<line>" (git 2.46+) or "<legacy> <line>" ("on line 5", "at line 5"). */
|
|
45
|
+
protected at(linenr: number, legacy?: string): string;
|
|
46
|
+
protected quote(name: string): string;
|
|
47
|
+
/** `use_patch`: whether --include/--exclude keep the patch. */
|
|
48
|
+
usePatch(p: FilePatch, wildmatch: (pattern: string, text: string) => boolean): boolean;
|
|
49
|
+
private findNameGnu;
|
|
50
|
+
private findNameCommon;
|
|
51
|
+
private findName;
|
|
52
|
+
private findNameTraditional;
|
|
53
|
+
private guessPValue;
|
|
54
|
+
private parseTraditionalPatch;
|
|
55
|
+
private verifyName;
|
|
56
|
+
private parseModeLine;
|
|
57
|
+
private checkHeaderLine;
|
|
58
|
+
/** One extended header line; 1 ends the header, -1 fails. */
|
|
59
|
+
private gitdiffLine;
|
|
60
|
+
/** `parse_git_diff_header`: the header's length, or -128. */
|
|
61
|
+
private parseGitDiffHeader;
|
|
62
|
+
/** `find_header`: the header's offset (and `hdrsize`), -1 when none, -128 on error. */
|
|
63
|
+
private findHeader;
|
|
64
|
+
/** `record_ws_error`. */
|
|
65
|
+
protected recordWsError(result: number, line: string, linenr: number): void;
|
|
66
|
+
/** `check_whitespace` of a hunk line (its first byte the +/-/space). */
|
|
67
|
+
private checkWhitespace;
|
|
68
|
+
private parseFragment;
|
|
69
|
+
private recountDiff;
|
|
70
|
+
private parseSinglePatch;
|
|
71
|
+
private parseBinaryHunk;
|
|
72
|
+
private parseBinary;
|
|
73
|
+
/**
|
|
74
|
+
* `parse_chunk`: reads one file's patch at `at`; the bytes it took, -1 when there is no
|
|
75
|
+
* more, -128 on a fatal error.
|
|
76
|
+
*/
|
|
77
|
+
parseChunk(buf: string, at: number, size: number, patch: FilePatch, wsRuleOf: (patch: FilePatch) => Promise<number>): Promise<number>;
|
|
78
|
+
}
|
|
79
|
+
export declare function metadataChanges(patch: FilePatch): boolean;
|
|
80
|
+
/**
|
|
81
|
+
* usage.c's `vreportf`: the prefixed message cut at a NUL and at 4095 bytes, control
|
|
82
|
+
* characters but tab and newline shown as `?`, ended by a newline.
|
|
83
|
+
*/
|
|
84
|
+
export declare function vreportf(prefix: string, message: string): string;
|
|
85
|
+
export { latin1ToBytes };
|
|
86
|
+
//# sourceMappingURL=apply-parse.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apply-parse.d.ts","sourceRoot":"","sources":["../../../src/commands/apply/apply-parse.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,EAIL,KAAK,SAAS,EAGd,KAAK,aAAa,EACnB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAmC,aAAa,EAAE,MAAM,aAAa,CAAC;AAY7E,gDAAgD;AAChD,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAKxC,wEAAwE;AACxE,wBAAgB,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAKrE;AAqOD,sFAAsF;AACtF,qBAAa,WAAW;IACtB,IAAI,SAAM;IACV,MAAM,SAAK;IACX,WAAW,UAAS;IACpB,MAAM,SAAK;IACX,cAAc,SAAa;IAC3B,qFAAqF;IACrF,cAAc,UAAS;IACvB,cAAc,UAAS;IACvB,aAAa,EAAE,aAAa,CAAU;IACtC,uBAAuB,SAAK;IAC5B,eAAe,SAAK;IACpB,SAAS,EAAE,cAAc,CAAK;IAC9B,KAAK,UAAQ;IACb,KAAK,UAAS;IACd,WAAW,EAAE;QAAE,OAAO,EAAE,MAAM,C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zB;;;OAGG;IACG,UAAU,CACd,GAAG,EAAE,MAAM,EACX,EAAE,EAAE,MAAM,EACV,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,SAAS,EAChB,QAAQ,EAAE,CAAC,KAAK,EAAE,SAAS,KAAK,OAAO,CAAC,MAAM,CAAC,GAC9C,OAAO,CAAC,MAAM,CAAC,CAqCjB;CACF;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,SAAS,GAAG,OAAO,CAQzD;AAgID;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAQhE;AAED,OAAO,EAAE,aAAa,EAAE,CAAC"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The patch model of `git apply` (apply.c's `struct patch` and `struct fragment`). Names and
|
|
3
|
+
* contents are binary strings (one character per byte).
|
|
4
|
+
*/
|
|
5
|
+
/** Deflated binary delta hunk (`BINARY_DELTA_DEFLATED`). */
|
|
6
|
+
export declare const BINARY_DELTA = 1;
|
|
7
|
+
/** Deflated binary literal hunk (`BINARY_LITERAL_DEFLATED`). */
|
|
8
|
+
export declare const BINARY_LITERAL = 2;
|
|
9
|
+
/** One hunk: `@@ -oldpos,oldlines +newpos,newlines @@` and its lines. */
|
|
10
|
+
export interface PatchFragment {
|
|
11
|
+
leading: number;
|
|
12
|
+
trailing: number;
|
|
13
|
+
oldpos: number;
|
|
14
|
+
oldlines: number;
|
|
15
|
+
newpos: number;
|
|
16
|
+
newlines: number;
|
|
17
|
+
/** The hunk text (a text hunk) or the inflated data (a binary hunk) */
|
|
18
|
+
patch: string;
|
|
19
|
+
size: number;
|
|
20
|
+
linenr: number;
|
|
21
|
+
rejected: boolean;
|
|
22
|
+
/** A binary hunk's method ({@link BINARY_DELTA} or {@link BINARY_LITERAL}) */
|
|
23
|
+
binaryMethod?: number;
|
|
24
|
+
}
|
|
25
|
+
/** The changes to one file. */
|
|
26
|
+
export interface FilePatch {
|
|
27
|
+
defName: string | null;
|
|
28
|
+
oldName: string | null;
|
|
29
|
+
newName: string | null;
|
|
30
|
+
/** 1 yes, 0 no, -1 not known yet */
|
|
31
|
+
isNew: number;
|
|
32
|
+
isDelete: number;
|
|
33
|
+
isRename: boolean;
|
|
34
|
+
isCopy: boolean;
|
|
35
|
+
isBinary: boolean;
|
|
36
|
+
isToplevelRelative: boolean;
|
|
37
|
+
inaccurateEof: boolean;
|
|
38
|
+
recount: boolean;
|
|
39
|
+
crlfInOld: boolean;
|
|
40
|
+
oldMode: number;
|
|
41
|
+
newMode: number;
|
|
42
|
+
score: number;
|
|
43
|
+
wsRule: number;
|
|
44
|
+
linesAdded: number;
|
|
45
|
+
linesDeleted: number;
|
|
46
|
+
extensionLinenr: number;
|
|
47
|
+
oldOidPrefix: string;
|
|
48
|
+
newOidPrefix: string;
|
|
49
|
+
fragments: PatchFragment[];
|
|
50
|
+
rejected: boolean;
|
|
51
|
+
result?: string;
|
|
52
|
+
directToThreeway: boolean;
|
|
53
|
+
conflictedThreeway: boolean;
|
|
54
|
+
/** Stages 1-3 of a conflicted three-way merge (null: none) */
|
|
55
|
+
threewayStage: [string | null, string | null, string | null];
|
|
56
|
+
}
|
|
57
|
+
export declare function newFilePatch(): FilePatch;
|
|
58
|
+
export declare const S_IFMT = 61440;
|
|
59
|
+
export declare const S_IFREG = 32768;
|
|
60
|
+
export declare const S_IFLNK = 40960;
|
|
61
|
+
export declare const S_IFDIR = 16384;
|
|
62
|
+
export declare const S_IFGITLINK = 57344;
|
|
63
|
+
export declare const isLink: (mode: number) => boolean;
|
|
64
|
+
export declare const isGitlink: (mode: number) => boolean;
|
|
65
|
+
export declare const isRegular: (mode: number) => boolean;
|
|
66
|
+
/** `canon_mode`: a regular file 644 or 755, a link, a directory or a gitlink. */
|
|
67
|
+
export declare function canonMode(mode: number): number;
|
|
68
|
+
/** How whitespace errors are treated (`--whitespace`). */
|
|
69
|
+
export type WsErrorAction = "nowarn" | "warn" | "error" | "fix";
|
|
70
|
+
//# sourceMappingURL=apply-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apply-types.d.ts","sourceRoot":"","sources":["../../../src/commands/apply/apply-types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,4DAA4D;AAC5D,eAAO,MAAM,YAAY,IAAI,CAAC;AAC9B,gEAAgE;AAChE,eAAO,MAAM,cAAc,IAAI,CAAC;AAEhC,yEAAyE;AACzE,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,uEAAuE;IACvE,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,OAAO,CAAC;IAClB,8EAA8E;IAC9E,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,+BAA+B;AAC/B,MAAM,WAAW,SAAS;IACxB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,oCAAoC;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,OAAO,CAAC;IAClB,MAAM,EAAE,OAAO,CAAC;IAChB,QAAQ,EAAE,OAAO,CAAC;IAClB,kBAAkB,EAAE,OAAO,CAAC;IAC5B,aAAa,EAAE,OAAO,CAAC;IACvB,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,OAAO,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,eAAe,EAAE,MAAM,CAAC;IACxB,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,aAAa,EAAE,CAAC;IAC3B,QAAQ,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,kBAAkB,EAAE,OAAO,CAAC;IAC5B,8DAA8D;IAC9D,aAAa,EAAE,CAAC,MAAM,GAAG,IAAI,EAAE,MAAM,GAAG,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC,CAAC;CAC9D;AAED,wBAAgB,YAAY,IAAI,SAAS,CA6BxC;AAED,eAAO,MAAM,MAAM,QAAW,CAAC;AAC/B,eAAO,MAAM,OAAO,QAAW,CAAC;AAChC,eAAO,MAAM,OAAO,QAAW,CAAC;AAChC,eAAO,MAAM,OAAO,QAAW,CAAC;AAChC,eAAO,MAAM,WAAW,QAAW,CAAC;AAEpC,eAAO,MAAM,MAAM,SAAU,MAAM,YAAgC,CAAC;AACpE,eAAO,MAAM,SAAS,SAAU,MAAM,YAAoC,CAAC;AAC3E,eAAO,MAAM,SAAS,SAAU,MAAM,YAAgC,CAAC;AAEvE,iFAAiF;AACjF,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAM9C;AAED,0DAA0D;AAC1D,MAAM,MAAM,aAAa,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,GAAG,KAAK,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export * from "./apply-command.js";
|
|
2
|
+
export type { ApplyIndexEntry, ApplyInput, ApplyIO } from "./apply-engine.js";
|
|
3
|
+
export { ApplyEngine } from "./apply-engine.js";
|
|
4
|
+
export type { FilePatch, PatchFragment, WsErrorAction } from "./apply-types.js";
|
|
5
|
+
export { bytesToLatin1, latin1ToBytes, latin1ToPath, pathToLatin1 } from "./latin1.js";
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/apply/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,YAAY,EAAE,eAAe,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC9E,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,YAAY,EAAE,SAAS,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAChF,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* "Binary strings": bytes held one per character (latin1), so that `git apply` and the
|
|
3
|
+
* mail tools can port git's byte-oriented C string handling while passing any encoding
|
|
4
|
+
* through unchanged.
|
|
5
|
+
*/
|
|
6
|
+
/** The bytes as a binary string. */
|
|
7
|
+
export declare function bytesToLatin1(bytes: Uint8Array): string;
|
|
8
|
+
/** The binary string's bytes. */
|
|
9
|
+
export declare function latin1ToBytes(text: string): Uint8Array;
|
|
10
|
+
/** The binary string read as UTF-8 text (as a terminal shows git's output). */
|
|
11
|
+
export declare function latin1ToText(text: string): string;
|
|
12
|
+
/** The UTF-8 bytes of `text` as a binary string. */
|
|
13
|
+
export declare function textToLatin1(text: string): string;
|
|
14
|
+
/** A path held as a binary string, as the repository's path strings (`decodeGitPath`). */
|
|
15
|
+
export declare function latin1ToPath(name: string): string;
|
|
16
|
+
/** A repository path string as a binary string of its bytes. */
|
|
17
|
+
export declare function pathToLatin1(path: string): string;
|
|
18
|
+
/** Whether `quote_c_style` would quote the name. */
|
|
19
|
+
export declare function needsCQuote(name: string, fully?: boolean): boolean;
|
|
20
|
+
/** The name's `quote_c_style` body (no surrounding quotes), escaping as needed. */
|
|
21
|
+
export declare function cQuoteBody(name: string, fully?: boolean): string;
|
|
22
|
+
/** `quote_c_style` of a binary-string name: quoted with C escapes when it needs to be. */
|
|
23
|
+
export declare function cQuote(name: string, fully?: boolean): string;
|
|
24
|
+
/**
|
|
25
|
+
* `unquote_c_style`: the name quoted at `start` (which holds `"`), and the index one past
|
|
26
|
+
* its closing quote; undefined when it is not a valid quoted name.
|
|
27
|
+
*/
|
|
28
|
+
export declare function cUnquote(text: string, start?: number): {
|
|
29
|
+
name: string;
|
|
30
|
+
end: number;
|
|
31
|
+
} | undefined;
|
|
32
|
+
//# sourceMappingURL=latin1.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"latin1.d.ts","sourceRoot":"","sources":["../../../src/commands/apply/latin1.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,oCAAoC;AACpC,wBAAgB,aAAa,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CAMvD;AAED,iCAAiC;AACjC,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,CAItD;AAKD,+EAA+E;AAC/E,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEjD;AAED,oDAAoD;AACpD,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEjD;AAED,0FAA0F;AAC1F,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEjD;AAED,gEAAgE;AAChE,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEjD;AAmCD,oDAAoD;AACpD,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,UAAO,GAAG,OAAO,CAG/D;AAED,mFAAmF;AACnF,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,UAAO,GAAG,MAAM,CAY7D;AAED,0FAA0F;AAC1F,wBAAgB,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,UAAO,GAAG,MAAM,CAEzD;AAED;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,SAAI,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,CA0D3F"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* git's whitespace rules (`ws.c`): the `core.whitespace` / `whitespace` attribute rules, the
|
|
3
|
+
* check `git apply` and `git diff --check` run on added lines, and the fix
|
|
4
|
+
* `--whitespace=fix` applies.
|
|
5
|
+
*
|
|
6
|
+
* Lines are "binary strings": one character per byte (latin1), so a line's length is its
|
|
7
|
+
* byte count and any encoding passes through unchanged.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```typescript
|
|
11
|
+
* const rule = parseWhitespaceRule("trailing-space,-space-before-tab");
|
|
12
|
+
* wsCheck("x \n", rule); // WS_BLANK_AT_EOL
|
|
13
|
+
* wsFixCopy("x \n", rule).text; // "x\n"
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
16
|
+
export declare const WS_BLANK_AT_EOL: number;
|
|
17
|
+
export declare const WS_SPACE_BEFORE_TAB: number;
|
|
18
|
+
export declare const WS_INDENT_WITH_NON_TAB: number;
|
|
19
|
+
export declare const WS_CR_AT_EOL: number;
|
|
20
|
+
export declare const WS_BLANK_AT_EOF: number;
|
|
21
|
+
export declare const WS_TAB_IN_INDENT: number;
|
|
22
|
+
export declare const WS_INCOMPLETE_LINE: number;
|
|
23
|
+
export declare const WS_TRAILING_SPACE: number;
|
|
24
|
+
export declare const WS_DEFAULT_RULE: number;
|
|
25
|
+
export declare const WS_TAB_WIDTH_MASK: number;
|
|
26
|
+
/** The tab width a rule carries (`ws_tab_width`). */
|
|
27
|
+
export declare function wsTabWidth(rule: number): number;
|
|
28
|
+
/** git's `isspace`: space, tab, LF and CR only (not VT or FF). */
|
|
29
|
+
export declare function isGitSpace(ch: number): boolean;
|
|
30
|
+
/** An invalid rule combination (git dies). */
|
|
31
|
+
export declare class WhitespaceRuleError extends Error {
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Parses a `core.whitespace` value (or a `whitespace=<rules>` attribute) as
|
|
35
|
+
* `parse_whitespace_rule` does: comma-separated names, `-name` to turn one off,
|
|
36
|
+
* `tabwidth=<n>`.
|
|
37
|
+
*/
|
|
38
|
+
export declare function parseWhitespaceRule(value: string, warn?: (message: string) => void): number;
|
|
39
|
+
/**
|
|
40
|
+
* The rule for one path (`whitespace_rule`): from its `whitespace` attribute (true, false,
|
|
41
|
+
* unset or a rule list), `configRule` (`core.whitespace`) by default.
|
|
42
|
+
*/
|
|
43
|
+
export declare function whitespaceRuleOf(attribute: boolean | string | undefined, configRule: number): number;
|
|
44
|
+
/** The message naming the errors in `ws` (`whitespace_error_string`). */
|
|
45
|
+
export declare function whitespaceErrorString(ws: number): string;
|
|
46
|
+
/** The whitespace errors of one line (with or without its LF), as `ws_check` finds them. */
|
|
47
|
+
export declare function wsCheck(line: string, rule: number): number;
|
|
48
|
+
/** Whether a line holds whitespace only (`ws_blank_line`). */
|
|
49
|
+
export declare function wsBlankLine(line: string, start?: number, end?: number): boolean;
|
|
50
|
+
/**
|
|
51
|
+
* The line with its whitespace errors fixed (`ws_fix_copy`); `fixed` tells whether anything
|
|
52
|
+
* changed.
|
|
53
|
+
*/
|
|
54
|
+
export declare function wsFixCopy(src: string, rule: number): {
|
|
55
|
+
text: string;
|
|
56
|
+
fixed: boolean;
|
|
57
|
+
};
|
|
58
|
+
//# sourceMappingURL=whitespace.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"whitespace.d.ts","sourceRoot":"","sources":["../../../src/commands/apply/whitespace.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;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