@statewalker/vcs-commands 0.6.0 → 0.8.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/dist/commands/add-command.d.ts +38 -0
- package/dist/commands/add-command.d.ts.map +1 -1
- package/dist/commands/am/am-command.d.ts +55 -1
- package/dist/commands/am/am-command.d.ts.map +1 -1
- package/dist/commands/am/index.d.ts +1 -0
- package/dist/commands/am/index.d.ts.map +1 -1
- package/dist/commands/am/mailsplit.d.ts +88 -0
- package/dist/commands/am/mailsplit.d.ts.map +1 -0
- package/dist/commands/apply/apply-command.d.ts.map +1 -1
- package/dist/commands/apply/apply-engine.d.ts.map +1 -1
- package/dist/commands/apply/apply-parse.d.ts.map +1 -1
- package/dist/commands/bisect/bisect-command.d.ts +2 -0
- package/dist/commands/bisect/bisect-command.d.ts.map +1 -1
- package/dist/commands/bisect/bisect-engine.d.ts.map +1 -1
- package/dist/commands/branch-command.d.ts +148 -18
- package/dist/commands/branch-command.d.ts.map +1 -1
- package/dist/commands/branch-info-command.d.ts +55 -0
- package/dist/commands/branch-info-command.d.ts.map +1 -0
- package/dist/commands/branch-tracking.d.ts +106 -17
- package/dist/commands/branch-tracking.d.ts.map +1 -1
- package/dist/commands/branch-upstream-command.d.ts +83 -0
- package/dist/commands/branch-upstream-command.d.ts.map +1 -0
- package/dist/commands/checkout-command.d.ts +19 -3
- package/dist/commands/checkout-command.d.ts.map +1 -1
- package/dist/commands/cherry-pick-command.d.ts +59 -0
- package/dist/commands/cherry-pick-command.d.ts.map +1 -1
- package/dist/commands/clean-command.d.ts +12 -0
- package/dist/commands/clean-command.d.ts.map +1 -1
- package/dist/commands/clone-command.d.ts +17 -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 +191 -5
- package/dist/commands/commit-command.d.ts.map +1 -1
- package/dist/commands/commit-reuse.d.ts +33 -0
- package/dist/commands/commit-reuse.d.ts.map +1 -0
- package/dist/commands/config-command.d.ts +236 -0
- package/dist/commands/config-command.d.ts.map +1 -0
- package/dist/commands/config-value-types.d.ts +91 -0
- package/dist/commands/config-value-types.d.ts.map +1 -0
- package/dist/commands/core-config.d.ts +20 -0
- package/dist/commands/core-config.d.ts.map +1 -1
- package/dist/commands/default-branch.d.ts +70 -0
- package/dist/commands/default-branch.d.ts.map +1 -0
- package/dist/commands/diff-color-config.d.ts +73 -0
- package/dist/commands/diff-color-config.d.ts.map +1 -0
- package/dist/commands/diff-command.d.ts +252 -5
- package/dist/commands/diff-command.d.ts.map +1 -1
- package/dist/commands/fetch-command.d.ts +20 -0
- package/dist/commands/fetch-command.d.ts.map +1 -1
- package/dist/commands/fmt-merge-msg-command.d.ts +124 -0
- package/dist/commands/fmt-merge-msg-command.d.ts.map +1 -0
- package/dist/commands/fork-point.d.ts +38 -0
- package/dist/commands/fork-point.d.ts.map +1 -0
- package/dist/commands/format-patch-command.d.ts +41 -1
- package/dist/commands/format-patch-command.d.ts.map +1 -1
- package/dist/commands/fsck/fetch-fsck.d.ts +51 -0
- package/dist/commands/fsck/fetch-fsck.d.ts.map +1 -1
- package/dist/commands/fsck/fsck-command.d.ts +2 -0
- package/dist/commands/fsck/fsck-command.d.ts.map +1 -1
- package/dist/commands/fsck/fsck-loose.d.ts +3 -0
- package/dist/commands/fsck/fsck-loose.d.ts.map +1 -1
- package/dist/commands/fsck/fsck-object-checks.d.ts +25 -14
- package/dist/commands/fsck/fsck-object-checks.d.ts.map +1 -1
- package/dist/commands/fsck/fsck-object-table.d.ts +15 -7
- package/dist/commands/fsck/fsck-object-table.d.ts.map +1 -1
- package/dist/commands/fsck/fsck-pack.d.ts +11 -4
- package/dist/commands/fsck/fsck-pack.d.ts.map +1 -1
- package/dist/commands/fsck/verify-pack-command.d.ts.map +1 -1
- package/dist/commands/gc-command.d.ts +80 -48
- package/dist/commands/gc-command.d.ts.map +1 -1
- package/dist/commands/git-date.d.ts +1 -65
- package/dist/commands/git-date.d.ts.map +1 -1
- package/dist/commands/git-describe.d.ts +4 -0
- package/dist/commands/git-describe.d.ts.map +1 -1
- package/dist/commands/git-hooks.d.ts +43 -0
- package/dist/commands/git-hooks.d.ts.map +1 -1
- package/dist/commands/grep/grep-command.d.ts +210 -0
- package/dist/commands/grep/grep-command.d.ts.map +1 -0
- package/dist/commands/grep/grep-engine.d.ts +218 -0
- package/dist/commands/grep/grep-engine.d.ts.map +1 -0
- package/dist/commands/grep/index.d.ts +3 -0
- package/dist/commands/grep/index.d.ts.map +1 -0
- package/dist/commands/index-adder.d.ts +15 -2
- package/dist/commands/index-adder.d.ts.map +1 -1
- package/dist/commands/index.d.ts +28 -0
- package/dist/commands/index.d.ts.map +1 -1
- package/dist/commands/index.js +3 -3
- package/dist/commands/init-command.d.ts +50 -3
- package/dist/commands/init-command.d.ts.map +1 -1
- package/dist/commands/interpret-trailers-command.d.ts +90 -0
- package/dist/commands/interpret-trailers-command.d.ts.map +1 -0
- package/dist/commands/legacy-remotes.d.ts +55 -0
- package/dist/commands/legacy-remotes.d.ts.map +1 -0
- package/dist/commands/local-transport.d.ts +36 -5
- package/dist/commands/local-transport.d.ts.map +1 -1
- package/dist/commands/log-command.d.ts +296 -11
- package/dist/commands/log-command.d.ts.map +1 -1
- package/dist/commands/log-graph.d.ts +26 -1
- package/dist/commands/log-graph.d.ts.map +1 -1
- package/dist/commands/log-output.d.ts +133 -5
- package/dist/commands/log-output.d.ts.map +1 -1
- package/dist/commands/ls-remote-command.d.ts +2 -0
- package/dist/commands/ls-remote-command.d.ts.map +1 -1
- package/dist/commands/mailmap.d.ts +30 -0
- package/dist/commands/mailmap.d.ts.map +1 -1
- package/dist/commands/merge-base-command.d.ts +60 -0
- package/dist/commands/merge-base-command.d.ts.map +1 -0
- package/dist/commands/merge-bases.d.ts +23 -0
- package/dist/commands/merge-bases.d.ts.map +1 -1
- package/dist/commands/merge-command.d.ts +108 -9
- package/dist/commands/merge-command.d.ts.map +1 -1
- package/dist/commands/merge-support.d.ts +11 -3
- package/dist/commands/merge-support.d.ts.map +1 -1
- package/dist/commands/mv-command.d.ts +4 -0
- package/dist/commands/mv-command.d.ts.map +1 -1
- package/dist/commands/name-rev.d.ts +48 -0
- package/dist/commands/name-rev.d.ts.map +1 -0
- package/dist/commands/notes-command.d.ts.map +1 -1
- package/dist/commands/notes-merge-command.d.ts.map +1 -1
- package/dist/commands/notes-tree.d.ts +11 -1
- package/dist/commands/notes-tree.d.ts.map +1 -1
- package/dist/commands/patch-id.d.ts +3 -0
- package/dist/commands/patch-id.d.ts.map +1 -1
- package/dist/commands/pathspec-file.d.ts +39 -0
- package/dist/commands/pathspec-file.d.ts.map +1 -0
- package/dist/commands/pathspec.d.ts +3 -0
- package/dist/commands/pathspec.d.ts.map +1 -1
- package/dist/commands/pretty-format.d.ts +43 -3
- package/dist/commands/pretty-format.d.ts.map +1 -1
- package/dist/commands/promisor-remote.d.ts.map +1 -1
- package/dist/commands/pull-command.d.ts +28 -0
- package/dist/commands/pull-command.d.ts.map +1 -1
- package/dist/commands/push-command.d.ts +160 -9
- package/dist/commands/push-command.d.ts.map +1 -1
- package/dist/commands/read-tree-command.d.ts +6 -0
- package/dist/commands/read-tree-command.d.ts.map +1 -1
- package/dist/commands/rebase-command.d.ts +168 -6
- package/dist/commands/rebase-command.d.ts.map +1 -1
- package/dist/commands/ref-filter/for-each-ref-command.d.ts +121 -0
- package/dist/commands/ref-filter/for-each-ref-command.d.ts.map +1 -0
- package/dist/commands/ref-filter/index.d.ts +8 -0
- package/dist/commands/ref-filter/index.d.ts.map +1 -0
- package/dist/commands/ref-filter/ref-atoms.d.ts +88 -0
- package/dist/commands/ref-filter/ref-atoms.d.ts.map +1 -0
- package/dist/commands/ref-filter/ref-filter.d.ts +178 -0
- package/dist/commands/ref-filter/ref-filter.d.ts.map +1 -0
- package/dist/commands/ref-filter/ref-format.d.ts +222 -0
- package/dist/commands/ref-filter/ref-format.d.ts.map +1 -0
- package/dist/commands/ref-filter/ref-listing-command.d.ts +56 -0
- package/dist/commands/ref-filter/ref-listing-command.d.ts.map +1 -0
- package/dist/commands/ref-filter/ref-quote.d.ts +20 -0
- package/dist/commands/ref-filter/ref-quote.d.ts.map +1 -0
- package/dist/commands/ref-filter/version-compare.d.ts +20 -0
- package/dist/commands/ref-filter/version-compare.d.ts.map +1 -0
- package/dist/commands/reflog-command.d.ts +120 -0
- package/dist/commands/reflog-command.d.ts.map +1 -1
- package/dist/commands/reflog-walk.d.ts +72 -0
- package/dist/commands/reflog-walk.d.ts.map +1 -0
- package/dist/commands/remote-command.d.ts +138 -29
- package/dist/commands/remote-command.d.ts.map +1 -1
- package/dist/commands/remote-transport.d.ts +7 -1
- package/dist/commands/remote-transport.d.ts.map +1 -1
- package/dist/commands/reset-command.d.ts +2 -3
- package/dist/commands/reset-command.d.ts.map +1 -1
- package/dist/commands/restore-command.d.ts +2 -3
- package/dist/commands/restore-command.d.ts.map +1 -1
- package/dist/commands/rev-filter/commit-filter.d.ts +95 -0
- package/dist/commands/rev-filter/commit-filter.d.ts.map +1 -0
- package/dist/commands/rev-filter/commit-grep.d.ts +91 -0
- package/dist/commands/rev-filter/commit-grep.d.ts.map +1 -0
- package/dist/commands/rev-filter/index.d.ts +3 -0
- package/dist/commands/rev-filter/index.d.ts.map +1 -0
- package/dist/commands/rev-list-command.d.ts +154 -2
- 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 -0
- package/dist/commands/revert-command.d.ts.map +1 -1
- package/dist/commands/revision-range.d.ts +32 -1
- package/dist/commands/revision-range.d.ts.map +1 -1
- package/dist/commands/revision-resolver.d.ts +21 -2
- package/dist/commands/revision-resolver.d.ts.map +1 -1
- package/dist/commands/rm-command.d.ts +70 -2
- package/dist/commands/rm-command.d.ts.map +1 -1
- package/dist/commands/sequencer-pick.d.ts +85 -5
- package/dist/commands/sequencer-pick.d.ts.map +1 -1
- package/dist/commands/sequencer-support.d.ts +2 -0
- package/dist/commands/sequencer-support.d.ts.map +1 -1
- package/dist/commands/serve-repository.d.ts +7 -0
- package/dist/commands/serve-repository.d.ts.map +1 -1
- package/dist/commands/show-command.d.ts +130 -0
- package/dist/commands/show-command.d.ts.map +1 -0
- package/dist/commands/show-commit.d.ts +11 -0
- package/dist/commands/show-commit.d.ts.map +1 -0
- package/dist/commands/signature-check.d.ts +164 -0
- package/dist/commands/signature-check.d.ts.map +1 -0
- package/dist/commands/signing.d.ts +160 -0
- package/dist/commands/signing.d.ts.map +1 -0
- package/dist/commands/sparse-checkout-command.d.ts.map +1 -1
- package/dist/commands/sparse-index-view.d.ts +45 -0
- package/dist/commands/sparse-index-view.d.ts.map +1 -0
- package/dist/commands/ssh-signer.d.ts +29 -0
- package/dist/commands/ssh-signer.d.ts.map +1 -0
- package/dist/commands/ssh-verifier.d.ts +42 -0
- package/dist/commands/ssh-verifier.d.ts.map +1 -0
- package/dist/commands/stash-apply-command.d.ts +5 -0
- package/dist/commands/stash-apply-command.d.ts.map +1 -1
- package/dist/commands/stash-branch-command.d.ts +34 -0
- package/dist/commands/stash-branch-command.d.ts.map +1 -0
- package/dist/commands/stash-create-command.d.ts +18 -1
- package/dist/commands/stash-create-command.d.ts.map +1 -1
- package/dist/commands/stash-info.d.ts +93 -0
- package/dist/commands/stash-info.d.ts.map +1 -0
- package/dist/commands/stash-list-command.d.ts +16 -0
- package/dist/commands/stash-list-command.d.ts.map +1 -1
- package/dist/commands/stash-pop-command.d.ts +39 -0
- package/dist/commands/stash-pop-command.d.ts.map +1 -0
- package/dist/commands/stash-show-command.d.ts +48 -0
- package/dist/commands/stash-show-command.d.ts.map +1 -0
- package/dist/commands/stash-store-command.d.ts +29 -0
- package/dist/commands/stash-store-command.d.ts.map +1 -0
- package/dist/commands/stash-working-tree.d.ts.map +1 -1
- package/dist/commands/status-command.d.ts.map +1 -1
- package/dist/commands/status-header.d.ts +5 -0
- package/dist/commands/status-header.d.ts.map +1 -1
- package/dist/commands/submodule-add-command.d.ts +89 -0
- package/dist/commands/submodule-add-command.d.ts.map +1 -0
- package/dist/commands/submodule-auth.d.ts +90 -0
- package/dist/commands/submodule-auth.d.ts.map +1 -0
- package/dist/commands/submodule-commands.d.ts +375 -0
- package/dist/commands/submodule-commands.d.ts.map +1 -0
- package/dist/commands/submodule-model.d.ts +288 -0
- package/dist/commands/submodule-model.d.ts.map +1 -0
- package/dist/commands/submodule-summary-command.d.ts.map +1 -1
- package/dist/commands/submodule-update-command.d.ts +198 -0
- package/dist/commands/submodule-update-command.d.ts.map +1 -0
- package/dist/commands/switch-command.d.ts.map +1 -1
- package/dist/commands/tag-command.d.ts +259 -10
- package/dist/commands/tag-command.d.ts.map +1 -1
- package/dist/commands/trailers.d.ts +218 -17
- package/dist/commands/trailers.d.ts.map +1 -1
- package/dist/commands/tree-restore.d.ts +7 -0
- package/dist/commands/tree-restore.d.ts.map +1 -1
- package/dist/commands/untracked-cache-support.d.ts +2 -1
- package/dist/commands/untracked-cache-support.d.ts.map +1 -1
- package/dist/commands/verify-command.d.ts +92 -0
- package/dist/commands/verify-command.d.ts.map +1 -0
- package/dist/commands/worktree-add-command.d.ts +79 -7
- package/dist/commands/worktree-add-command.d.ts.map +1 -1
- package/dist/commands/worktree-list-command.d.ts.map +1 -1
- package/dist/commands/worktree-path-rules.d.ts +66 -0
- package/dist/commands/worktree-path-rules.d.ts.map +1 -0
- package/dist/commands/worktree-remove-command.d.ts +10 -3
- package/dist/commands/worktree-remove-command.d.ts.map +1 -1
- package/dist/commands/worktree-repair-command.d.ts +15 -2
- package/dist/commands/worktree-repair-command.d.ts.map +1 -1
- package/dist/commands/worktree-support.d.ts +5 -0
- package/dist/commands/worktree-support.d.ts.map +1 -1
- package/dist/{commands-DnmlfwGV.js → commands-ISM52N0n.js} +66120 -49271
- package/dist/errors/checkout-errors.d.ts +19 -0
- package/dist/errors/checkout-errors.d.ts.map +1 -1
- package/dist/errors/command-errors.d.ts.map +1 -1
- package/dist/errors/index.js +57 -3
- package/dist/errors/ref-errors.d.ts +19 -0
- package/dist/errors/ref-errors.d.ts.map +1 -1
- package/dist/errors/worktree-errors.d.ts +6 -1
- package/dist/errors/worktree-errors.d.ts.map +1 -1
- package/dist/{git-command-DxvwPrPB.js → fsck-DLRpbwTj.js} +6863 -1070
- package/dist/git-command.d.ts +43 -2
- package/dist/git-command.d.ts.map +1 -1
- package/dist/git.d.ts +276 -3
- package/dist/git.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 +117 -3
- package/dist/remote-config/remote-config-store.d.ts.map +1 -1
- package/dist/rename/detect-renames.d.ts.map +1 -1
- package/dist/results/clone-result.d.ts +8 -0
- package/dist/results/clone-result.d.ts.map +1 -1
- package/dist/results/combined-diff.d.ts +3 -0
- package/dist/results/combined-diff.d.ts.map +1 -1
- package/dist/results/diff-check.d.ts +38 -0
- package/dist/results/diff-check.d.ts.map +1 -0
- package/dist/results/diff-color.d.ts +135 -0
- package/dist/results/diff-color.d.ts.map +1 -0
- package/dist/results/diff-output.d.ts +85 -1
- package/dist/results/diff-output.d.ts.map +1 -1
- package/dist/results/diff-pickaxe.d.ts +67 -0
- package/dist/results/diff-pickaxe.d.ts.map +1 -0
- package/dist/results/diff-words.d.ts +55 -0
- package/dist/results/diff-words.d.ts.map +1 -0
- package/dist/results/index.d.ts +4 -0
- package/dist/results/index.d.ts.map +1 -1
- package/dist/results/index.js +2 -2
- package/dist/results/init-result.d.ts +7 -0
- package/dist/results/init-result.d.ts.map +1 -1
- package/dist/results/pull-result.d.ts +5 -0
- package/dist/results/pull-result.d.ts.map +1 -1
- package/dist/results/push-result.d.ts +12 -0
- package/dist/results/push-result.d.ts.map +1 -1
- package/dist/results/rebase-result.d.ts +2 -0
- package/dist/results/rebase-result.d.ts.map +1 -1
- package/dist/results/stash-result.d.ts +6 -0
- package/dist/results/stash-result.d.ts.map +1 -1
- package/dist/results/status-result.d.ts.map +1 -1
- package/dist/{results-BZGa2Z3I.js → results-TB2IJ64h.js} +2178 -412
- package/dist/whitespace/index.d.ts +2 -0
- package/dist/whitespace/index.d.ts.map +1 -0
- package/dist/whitespace/whitespace-rule.d.ts +94 -0
- package/dist/whitespace/whitespace-rule.d.ts.map +1 -0
- package/package.json +12 -12
- package/src/commands/add-command.ts +178 -17
- package/src/commands/add-patch/add-interactive.ts +3 -3
- package/src/commands/am/am-command.ts +263 -43
- package/src/commands/am/index.ts +1 -0
- package/src/commands/am/mailsplit.ts +326 -0
- package/src/commands/apply/apply-command.ts +18 -8
- package/src/commands/apply/apply-engine.ts +6 -7
- package/src/commands/apply/apply-parse.ts +10 -10
- package/src/commands/attributes-source.ts +1 -1
- package/src/commands/bisect/bisect-command.ts +18 -5
- package/src/commands/bisect/bisect-engine.ts +2 -1
- package/src/commands/branch-command.ts +528 -53
- package/src/commands/branch-info-command.ts +150 -0
- package/src/commands/branch-tracking.ts +335 -60
- package/src/commands/branch-upstream-command.ts +218 -0
- package/src/commands/checkout-command.ts +70 -44
- package/src/commands/cherry-pick-command.ts +143 -0
- package/src/commands/clean-command.ts +34 -3
- package/src/commands/clone-command.ts +118 -5
- package/src/commands/comment-char-config.ts +160 -0
- package/src/commands/commit-command.ts +790 -71
- package/src/commands/commit-reuse.ts +94 -0
- package/src/commands/config-command.ts +1256 -0
- package/src/commands/config-value-types.ts +358 -0
- package/src/commands/core-config.ts +47 -2
- package/src/commands/default-branch.ts +196 -0
- package/src/commands/diff-color-config.ts +274 -0
- package/src/commands/diff-command.ts +1053 -75
- package/src/commands/fetch-command.ts +161 -13
- package/src/commands/fmt-merge-msg-command.ts +715 -0
- package/src/commands/fork-point.ts +63 -0
- package/src/commands/format-patch-command.ts +316 -43
- package/src/commands/fsck/fetch-fsck.ts +172 -18
- package/src/commands/fsck/fsck-command.ts +183 -66
- package/src/commands/fsck/fsck-loose.ts +14 -4
- package/src/commands/fsck/fsck-object-checks.ts +87 -46
- package/src/commands/fsck/fsck-object-table.ts +52 -42
- package/src/commands/fsck/fsck-pack.ts +64 -34
- package/src/commands/fsck/verify-pack-command.ts +5 -2
- package/src/commands/gc-command.ts +238 -107
- package/src/commands/git-date.ts +9 -895
- package/src/commands/git-describe.ts +31 -11
- package/src/commands/git-hooks.ts +92 -0
- package/src/commands/grep/grep-command.ts +1077 -0
- package/src/commands/grep/grep-engine.ts +1024 -0
- package/src/commands/grep/index.ts +2 -0
- package/src/commands/index-adder.ts +54 -10
- package/src/commands/index.ts +28 -0
- package/src/commands/init-command.ts +167 -11
- package/src/commands/interpret-trailers-command.ts +256 -0
- package/src/commands/legacy-remotes.ts +224 -0
- package/src/commands/local-transport.ts +109 -10
- package/src/commands/log-command.ts +1283 -232
- package/src/commands/log-graph.ts +123 -26
- package/src/commands/log-output.ts +280 -21
- package/src/commands/ls-remote-command.ts +9 -0
- package/src/commands/mailmap.ts +119 -0
- package/src/commands/merge-base-command.ts +170 -0
- package/src/commands/merge-bases.ts +63 -8
- package/src/commands/merge-command.ts +360 -82
- package/src/commands/merge-support.ts +43 -9
- package/src/commands/mv-command.ts +6 -3
- package/src/commands/name-rev.ts +171 -0
- package/src/commands/notes-command.ts +11 -1
- package/src/commands/notes-merge-command.ts +23 -14
- package/src/commands/notes-tree.ts +28 -13
- package/src/commands/octopus-merge.ts +3 -2
- package/src/commands/patch-id.ts +16 -8
- package/src/commands/pathspec-file.ts +72 -0
- package/src/commands/pathspec.ts +14 -2
- package/src/commands/pretty-format.ts +105 -20
- package/src/commands/promisor-remote.ts +10 -1
- package/src/commands/pull-command.ts +149 -22
- package/src/commands/push-command.ts +704 -72
- package/src/commands/read-tree-command.ts +34 -3
- package/src/commands/rebase-command.ts +957 -142
- package/src/commands/ref-filter/for-each-ref-command.ts +298 -0
- package/src/commands/ref-filter/index.ts +7 -0
- package/src/commands/ref-filter/ref-atoms.ts +581 -0
- package/src/commands/ref-filter/ref-filter.ts +651 -0
- package/src/commands/ref-filter/ref-format.ts +1070 -0
- package/src/commands/ref-filter/ref-listing-command.ts +421 -0
- package/src/commands/ref-filter/ref-quote.ts +69 -0
- package/src/commands/ref-filter/version-compare.ts +177 -0
- package/src/commands/reflog-command.ts +492 -2
- package/src/commands/reflog-walk.ts +234 -0
- package/src/commands/remote-command.ts +484 -74
- package/src/commands/remote-transport.ts +9 -1
- package/src/commands/reset-command.ts +40 -42
- package/src/commands/restore-command.ts +12 -41
- package/src/commands/rev-filter/commit-filter.ts +159 -0
- package/src/commands/rev-filter/commit-grep.ts +444 -0
- package/src/commands/rev-filter/index.ts +2 -0
- package/src/commands/rev-list-command.ts +402 -15
- package/src/commands/rev-parse-command.ts +22 -0
- package/src/commands/revert-command.ts +82 -0
- package/src/commands/revision-range.ts +204 -4
- package/src/commands/revision-resolver.ts +55 -22
- package/src/commands/rm-command.ts +282 -21
- package/src/commands/sequencer-pick.ts +504 -86
- package/src/commands/sequencer-support.ts +30 -5
- package/src/commands/serve-repository.ts +18 -3
- package/src/commands/show-command.ts +490 -0
- package/src/commands/show-commit.ts +24 -0
- package/src/commands/signature-check.ts +657 -0
- package/src/commands/signing.ts +385 -0
- package/src/commands/sparse-checkout-command.ts +2 -9
- package/src/commands/sparse-checkout-support.ts +2 -2
- package/src/commands/sparse-index-view.ts +135 -0
- package/src/commands/ssh-signer.ts +199 -0
- package/src/commands/ssh-verifier.ts +523 -0
- package/src/commands/stash-apply-command.ts +17 -5
- package/src/commands/stash-branch-command.ts +88 -0
- package/src/commands/stash-create-command.ts +30 -2
- package/src/commands/stash-info.ts +243 -0
- package/src/commands/stash-list-command.ts +33 -0
- package/src/commands/stash-pop-command.ts +83 -0
- package/src/commands/stash-show-command.ts +141 -0
- package/src/commands/stash-store-command.ts +82 -0
- package/src/commands/stash-working-tree.ts +2 -2
- package/src/commands/status-command.ts +7 -6
- package/src/commands/status-header.ts +44 -8
- package/src/commands/submodule-add-command.ts +509 -0
- package/src/commands/submodule-auth.ts +276 -0
- package/src/commands/submodule-commands.ts +1517 -0
- package/src/commands/submodule-model.ts +930 -0
- package/src/commands/submodule-summary-command.ts +6 -7
- package/src/commands/submodule-update-command.ts +1092 -0
- package/src/commands/switch-command.ts +3 -1
- package/src/commands/tag-command.ts +876 -64
- package/src/commands/trailers.ts +837 -100
- package/src/commands/tree-restore.ts +38 -10
- package/src/commands/untracked-cache-support.ts +16 -12
- package/src/commands/verify-command.ts +235 -0
- package/src/commands/worktree-add-command.ts +268 -24
- package/src/commands/worktree-list-command.ts +3 -5
- package/src/commands/worktree-path-rules.ts +183 -0
- package/src/commands/worktree-remove-command.ts +39 -5
- package/src/commands/worktree-repair-command.ts +52 -5
- package/src/commands/worktree-support.ts +22 -1
- package/src/core-commands/add.command.impl.ts +1 -1
- package/src/errors/checkout-errors.ts +29 -0
- package/src/errors/command-errors.ts +2 -1
- package/src/errors/ref-errors.ts +23 -0
- package/src/errors/worktree-errors.ts +8 -1
- package/src/git-command.ts +98 -3
- package/src/git.ts +420 -4
- package/src/remote-config/index.ts +4 -0
- package/src/remote-config/remote-config-store.ts +238 -11
- package/src/rename/detect-renames.ts +5 -1
- package/src/results/clone-result.ts +9 -0
- package/src/results/combined-diff.ts +38 -18
- package/src/results/diff-check.ts +185 -0
- package/src/results/diff-color.ts +868 -0
- package/src/results/diff-output.ts +204 -37
- package/src/results/diff-pickaxe.ts +304 -0
- package/src/results/diff-words.ts +395 -0
- package/src/results/index.ts +4 -0
- package/src/results/init-result.ts +9 -0
- package/src/results/pull-result.ts +5 -0
- package/src/results/push-result.ts +12 -0
- package/src/results/rebase-result.ts +3 -0
- package/src/results/stash-result.ts +7 -0
- package/src/results/status-result.ts +5 -2
- package/src/whitespace/index.ts +1 -0
- package/src/{commands/apply/whitespace.ts → whitespace/whitespace-rule.ts} +173 -23
- package/dist/commands/apply/whitespace.d.ts +0 -58
- package/dist/commands/apply/whitespace.d.ts.map +0 -1
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
* rather than half-way through rewriting it.
|
|
9
9
|
*/
|
|
10
10
|
import type { Blobs, ObjectId } from "@statewalker/vcs-core";
|
|
11
|
+
import { type WorktreePathOptions } from "@statewalker/vcs-core";
|
|
11
12
|
import { type ContentAttributesContext, type Staging, type Worktree } from "@statewalker/vcs-working-tree";
|
|
12
13
|
import type { CommandTrees } from "../git-command.js";
|
|
13
14
|
/** One file a restore plans to write back into the working tree. */
|
|
@@ -59,6 +60,10 @@ export interface TreeRestoreOptions {
|
|
|
59
60
|
foldsCase?: boolean;
|
|
60
61
|
/** The worktree is on Windows (`capabilities.windowsPaths`): git's Windows path rules. */
|
|
61
62
|
windows?: boolean;
|
|
63
|
+
/** `core.protectNTFS` (default true; `worktreePathRules` reads it) */
|
|
64
|
+
protectNTFS?: boolean;
|
|
65
|
+
/** `core.protectHFS` (default true here; `worktreePathRules` gives git's default) */
|
|
66
|
+
protectHFS?: boolean;
|
|
62
67
|
/** Top-level names the worktree's storage reserves (`capabilities.reservedNames`) */
|
|
63
68
|
reservedNames?: string[];
|
|
64
69
|
/**
|
|
@@ -169,6 +174,8 @@ export interface FreshCheckoutTarget {
|
|
|
169
174
|
* stays out of the worktree, as unpack-trees' loop #2 marks it); default every path.
|
|
170
175
|
*/
|
|
171
176
|
writes?: (path: string) => boolean;
|
|
177
|
+
/** git's `verify_path` rules (`worktreePathRules`); default both protections on */
|
|
178
|
+
pathRules?: WorktreePathOptions;
|
|
172
179
|
}
|
|
173
180
|
/**
|
|
174
181
|
* A tree checked out into an empty worktree and index, as `git clone` and
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tree-restore.d.ts","sourceRoot":"","sources":["../../src/commands/tree-restore.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"tree-restore.d.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,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,EACzD,OAAO,EAAE,GAAG,CAAC,MAAM,CAAC,EACpB,SAAS,EAAE,MAAM,EACjB,OAAO,GAAE,IAAI,CAAC,kBAAkB,EAAE,YAAY,GAAG,WAAW,GAAG,SAAS,CAAM,GAC7E,OAAO,CAAC,eAAe,CAAC,CAiC1B;AAED,kDAAkD;AAClD,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,YAAY,CAAC;IACpB,KAAK,EAAE,KAAK,CAAC;IACb,OAAO,EAAE,OAAO,CAAC;IACjB,6DAA6D;IAC7D,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,sFAAsF;IACtF,QAAQ,EAAE,OAAO,CAAC;IAClB,yBAAyB;IACzB,UAAU,EAAE,OAAO,CAAC;IACpB;;;OAGG;IACH,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC;IACnC,mFAAmF;IACnF,SAAS,CAAC,EAAE,mBAAmB,CAAC;CACjC;AAED;;;;;;;GAOG;AACH,wBAAsB,iBAAiB,CACrC,MAAM,EAAE,mBAAmB,EAC3B,MAAM,EAAE,QAAQ,EAChB,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,MAAM,EAAE,CAAC,CAqCnB"}
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
* if (state.changed()) await refreshIndexStats(staging, refresh, { untrackedCache: state.cache ?? null });
|
|
12
12
|
* ```
|
|
13
13
|
*/
|
|
14
|
+
import { type ObjectFormat } from "@statewalker/vcs-utils/hash";
|
|
14
15
|
import { type GitHostEnvironment, type Staging, type UntrackedCache, type UntrackedScanHost } from "@statewalker/vcs-working-tree";
|
|
15
16
|
/** `core.untrackedCache` as git's repo settings read it. */
|
|
16
17
|
export type UntrackedCacheSetting = "keep" | "write" | "remove";
|
|
@@ -49,5 +50,5 @@ export interface UntrackedCacheState {
|
|
|
49
50
|
* `core.untrackedCache` (an add needs the worktree's location and the system's name, git's
|
|
50
51
|
* ident), then offered to the scan.
|
|
51
52
|
*/
|
|
52
|
-
export declare function openUntrackedCache(staging: Staging, config: UntrackedCacheConfig, environment: GitHostEnvironment | undefined, host: UntrackedScanHost | undefined): UntrackedCacheState;
|
|
53
|
+
export declare function openUntrackedCache(staging: Staging, config: UntrackedCacheConfig, environment: GitHostEnvironment | undefined, host: UntrackedScanHost | undefined, objectFormat?: ObjectFormat): UntrackedCacheState;
|
|
53
54
|
//# sourceMappingURL=untracked-cache-support.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"untracked-cache-support.d.ts","sourceRoot":"","sources":["../../src/commands/untracked-cache-support.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAGH,OAAO,EAKL,KAAK,kBAAkB,
|
|
1
|
+
{"version":3,"file":"untracked-cache-support.d.ts","sourceRoot":"","sources":["../../src/commands/untracked-cache-support.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAGH,OAAO,EAAE,KAAK,YAAY,EAAsB,MAAM,6BAA6B,CAAC;AACpF,OAAO,EAKL,KAAK,kBAAkB,EAKvB,KAAK,OAAO,EAEZ,KAAK,cAAc,EACnB,KAAK,iBAAiB,EAKvB,MAAM,+BAA+B,CAAC;AAEvC,4DAA4D;AAC5D,MAAM,MAAM,qBAAqB,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,CAAC;AAEhE,oDAAoD;AACpD,MAAM,WAAW,oBAAoB;IACnC,KAAK,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;CACxC;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,oBAAoB,GAAG,qBAAqB,CASzF;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,oBAAoB,GAAG,MAAM,CAG3E;AAED,6CAA6C;AAC7C,MAAM,WAAW,mBAAmB;IAClC,sDAAsD;IACtD,QAAQ,CAAC,KAAK,EAAE,cAAc,GAAG,SAAS,CAAC;IAC3C;;;;;;;OAOG;IACH,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,GAAG,SAAS,CAAC,CAAC;IAC5D,4EAA4E;IAC5E,OAAO,IAAI,OAAO,CAAC;CACpB;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,oBAAoB,EAC5B,WAAW,EAAE,kBAAkB,GAAG,SAAS,EAC3C,IAAI,EAAE,iBAAiB,GAAG,SAAS,EACnC,YAAY,GAAE,YAAiC,GAC9C,mBAAmB,CAkErB"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `git verify-commit` (builtin/verify-commit.c) and `git verify-tag` (builtin/verify-tag.c,
|
|
3
|
+
* tag.c's `gpg_verify_tag`): each object's signature checked through the host's verifier
|
|
4
|
+
* (see {@link checkSignature}), what git prints gathered as its stdout and stderr.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```typescript
|
|
8
|
+
* const { exitCode, stderr } = await git.verifyCommit().addCommit("HEAD").call();
|
|
9
|
+
* // stderr: "gpg: Signature made ...\ngpg: Good signature from ..."
|
|
10
|
+
* const raw = await git.verifyTag().addTag("v1").setRaw(true).call();
|
|
11
|
+
* // raw.stderr: "[GNUPG:] NEWSIG\n[GNUPG:] GOODSIG ..."
|
|
12
|
+
* ```
|
|
13
|
+
*
|
|
14
|
+
* @module
|
|
15
|
+
*/
|
|
16
|
+
import type { ObjectId } from "@statewalker/vcs-core";
|
|
17
|
+
import { GitCommand } from "../git-command.js";
|
|
18
|
+
import { type SignatureCheck } from "./signature-check.js";
|
|
19
|
+
/** What `git verify-commit` / `git verify-tag` printed and its exit status. */
|
|
20
|
+
export interface VerifyResult {
|
|
21
|
+
/** 0 when every object had a signature good enough, else 1 */
|
|
22
|
+
readonly exitCode: 0 | 1;
|
|
23
|
+
/** git's stdout: with `-v`, each payload (a tag without signature: the whole tag) */
|
|
24
|
+
readonly stdout: Uint8Array;
|
|
25
|
+
/** git's stderr: errors, then each check's output (`--raw`: gpg's status lines) */
|
|
26
|
+
readonly stderr: string;
|
|
27
|
+
/** Each object named, in order, with its check when one was made */
|
|
28
|
+
readonly checks: readonly {
|
|
29
|
+
name: string;
|
|
30
|
+
id?: ObjectId;
|
|
31
|
+
check?: SignatureCheck;
|
|
32
|
+
}[];
|
|
33
|
+
}
|
|
34
|
+
/** One object's verification as the command's loop runs it. */
|
|
35
|
+
interface VerifyOutput {
|
|
36
|
+
out: Uint8Array[];
|
|
37
|
+
err: string[];
|
|
38
|
+
checks: {
|
|
39
|
+
name: string;
|
|
40
|
+
id?: ObjectId;
|
|
41
|
+
check?: SignatureCheck;
|
|
42
|
+
}[];
|
|
43
|
+
}
|
|
44
|
+
declare abstract class VerifyCommandBase extends GitCommand<VerifyResult> {
|
|
45
|
+
protected readonly names: string[];
|
|
46
|
+
protected verbose: boolean;
|
|
47
|
+
protected raw: boolean;
|
|
48
|
+
/** `-v` / `--verbose`: the object's contents on stdout. */
|
|
49
|
+
setVerbose(verbose: boolean): this;
|
|
50
|
+
/** `--raw`: gpg's status lines instead of its human-readable output. */
|
|
51
|
+
setRaw(raw: boolean): this;
|
|
52
|
+
/** The object's type and bytes as stored (undefined when absent). */
|
|
53
|
+
protected readObject(id: ObjectId): Promise<{
|
|
54
|
+
type: string;
|
|
55
|
+
bytes: Uint8Array;
|
|
56
|
+
} | undefined>;
|
|
57
|
+
/** `repo_get_oid`: the object a name gives, undefined when it names none. */
|
|
58
|
+
protected lookup(name: string): Promise<ObjectId | undefined>;
|
|
59
|
+
/** gpg-interface.c's `print_signature_buffer` */
|
|
60
|
+
protected print(check: SignatureCheck, output: VerifyOutput): void;
|
|
61
|
+
protected abstract verifyOne(name: string, output: VerifyOutput): Promise<boolean>;
|
|
62
|
+
call(): Promise<VerifyResult>;
|
|
63
|
+
protected abstract usage(): string;
|
|
64
|
+
/** The check's own lines (git's `error()`/`warning()` on the way), with newlines. */
|
|
65
|
+
protected messages(check: SignatureCheck, output: VerifyOutput): void;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* `git verify-commit [-v | --verbose] [--raw] <commit>...`: each commit's `gpgsig` checked.
|
|
69
|
+
* A name that names nothing is `error: commit '<name>' not found.`, one of another type
|
|
70
|
+
* `error: <name>: cannot verify a non-commit object of type <type>.`; an unsigned commit
|
|
71
|
+
* fails silently. Exit 1 when any fails.
|
|
72
|
+
*/
|
|
73
|
+
export declare class VerifyCommitCommand extends VerifyCommandBase {
|
|
74
|
+
/** A commit to verify (any revision). */
|
|
75
|
+
addCommit(name: string): this;
|
|
76
|
+
protected usage(): string;
|
|
77
|
+
protected verifyOne(name: string, output: VerifyOutput): Promise<boolean>;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* `git verify-tag [-v | --verbose] [--raw] <tag>...`: each tag's appended signature
|
|
81
|
+
* checked. A name that names nothing is `error: tag '<name>' not found.`, one of another
|
|
82
|
+
* type `error: <name>: cannot verify a non-tag object of type <type>.`, a tag without a
|
|
83
|
+
* signature `error: no signature found` (`-v` prints the tag first). Exit 1 when any fails.
|
|
84
|
+
*/
|
|
85
|
+
export declare class VerifyTagCommand extends VerifyCommandBase {
|
|
86
|
+
/** A tag to verify (any revision naming a tag object). */
|
|
87
|
+
addTag(name: string): this;
|
|
88
|
+
protected usage(): string;
|
|
89
|
+
protected verifyOne(name: string, output: VerifyOutput): Promise<boolean>;
|
|
90
|
+
}
|
|
91
|
+
export {};
|
|
92
|
+
//# sourceMappingURL=verify-command.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verify-command.d.ts","sourceRoot":"","sources":["../../src/commands/verify-command.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAGtD,OAAO,EAAE,UAAU,EAAE,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|
3
3
|
import { GitCommand } from "../git-command.js";
|
|
4
|
+
import { TrackMode } from "./branch-tracking.js";
|
|
4
5
|
/** What {@link WorktreeAddCommand} did. */
|
|
5
6
|
export interface WorktreeAddResult {
|
|
6
7
|
/** The new worktree's path, as git prints it. */
|
|
@@ -15,7 +16,11 @@ export interface WorktreeAddResult {
|
|
|
15
16
|
messages: string[];
|
|
16
17
|
/** The post-checkout hook's exit code when it failed (git exits with it; the worktree stays) */
|
|
17
18
|
hookExitCode?: number;
|
|
18
|
-
/**
|
|
19
|
+
/**
|
|
20
|
+
* What git prints on stdout without `--quiet`: the new branch's tracking
|
|
21
|
+
* (`branch 'x' set up to track 'origin/x'.`), then the checkout's
|
|
22
|
+
* `HEAD is now at <abbrev> <subject>`.
|
|
23
|
+
*/
|
|
19
24
|
output: string[];
|
|
20
25
|
/** A working copy of the new worktree. */
|
|
21
26
|
workingCopy: WorkingCopy;
|
|
@@ -24,7 +29,8 @@ export interface WorktreeAddResult {
|
|
|
24
29
|
* Add a linked worktree.
|
|
25
30
|
*
|
|
26
31
|
* Equivalent to `git worktree add [-f] [--detach] [--no-checkout] [--lock [--reason <r>]]
|
|
27
|
-
* [--orphan] [
|
|
32
|
+
* [--orphan] [--[no-]track] [--[no-]guess-remote] [--[no-]relative-paths]
|
|
33
|
+
* [(-b | -B) <new-branch>] <path> [<commit-ish>]`.
|
|
28
34
|
*
|
|
29
35
|
* @example
|
|
30
36
|
* ```typescript
|
|
@@ -33,6 +39,10 @@ export interface WorktreeAddResult {
|
|
|
33
39
|
* // detached at a tag, locked
|
|
34
40
|
* await git.worktreeAdd().setPath("../v1").setCommitish("v1.0").setDetach(true)
|
|
35
41
|
* .setLock(true).setLockReason("on a USB disk").call();
|
|
42
|
+
* // `git worktree add ../foo foo` with only origin/foo: branch foo tracking origin/foo
|
|
43
|
+
* await git.worktreeAdd().setPath("../foo").setCommitish("foo").call();
|
|
44
|
+
* // relative links (git 2.48+): extensions.relativeWorktrees is set
|
|
45
|
+
* await git.worktreeAdd().setPath("../rel").setRelativePaths(true).call();
|
|
36
46
|
* ```
|
|
37
47
|
*
|
|
38
48
|
* As git's `add`: without a commit-ish the new branch is named after the path's last
|
|
@@ -49,8 +59,15 @@ export interface WorktreeAddResult {
|
|
|
49
59
|
* HEAD and its reflog line; then, unless `--no-checkout`, the files and the index are
|
|
50
60
|
* checked out (git runs `reset --hard`: ORIG_HEAD and, on a branch, the reflog line
|
|
51
61
|
* `reset: moving to HEAD`). A failure removes what was created. The `post-checkout`
|
|
52
|
-
* hook runs in the new worktree once it is checked out (`<null> <HEAD> 1`)
|
|
53
|
-
*
|
|
62
|
+
* hook runs in the new worktree once it is checked out (`<null> <HEAD> 1`).
|
|
63
|
+
*
|
|
64
|
+
* Remote branches, as git's DWIM: a commit-ish that names no commit but the one
|
|
65
|
+
* remote-tracking branch of that name (`unique_tracking_name`, `checkout.defaultRemote`
|
|
66
|
+
* among several) creates a local branch from it; without a commit-ish,
|
|
67
|
+
* {@link setGuessRemote} (`worktree.guessRemote`) does the same for the name taken from the
|
|
68
|
+
* path. A new branch tracks its start as `git branch` does ({@link setTrack},
|
|
69
|
+
* `branch.autoSetupMerge`). Several matches die with git's advice in 2.5x; git 2.43
|
|
70
|
+
* ({@link setCompatibility}) takes them for no match.
|
|
54
71
|
*/
|
|
55
72
|
export declare class WorktreeAddCommand extends GitCommand<WorktreeAddResult> {
|
|
56
73
|
private path?;
|
|
@@ -65,6 +82,10 @@ export declare class WorktreeAddCommand extends GitCommand<WorktreeAddResult> {
|
|
|
65
82
|
private orphan;
|
|
66
83
|
private quiet;
|
|
67
84
|
private who?;
|
|
85
|
+
private track?;
|
|
86
|
+
private guessRemote?;
|
|
87
|
+
private relativePaths?;
|
|
88
|
+
private compatibility;
|
|
68
89
|
/** The new worktree's path (a path of the repository's storage, or an absolute host path). */
|
|
69
90
|
setPath(path: string): this;
|
|
70
91
|
/** What to check out (default: HEAD; with a new branch, its start). */
|
|
@@ -85,10 +106,53 @@ export declare class WorktreeAddCommand extends GitCommand<WorktreeAddResult> {
|
|
|
85
106
|
setOrphan(orphan: boolean): this;
|
|
86
107
|
/** `--quiet`: no messages. */
|
|
87
108
|
setQuiet(quiet: boolean): this;
|
|
109
|
+
/**
|
|
110
|
+
* `--track[=inherit]` / `--no-track`: how a new branch tracks its start (git passes it to
|
|
111
|
+
* its `git branch` child); without a new branch the add is refused.
|
|
112
|
+
*/
|
|
113
|
+
setTrack(mode: TrackMode): this;
|
|
114
|
+
/**
|
|
115
|
+
* `--[no-]guess-remote` (default `worktree.guessRemote`, false): without a commit-ish, the
|
|
116
|
+
* new branch named after the path starts at the remote-tracking branch of that name.
|
|
117
|
+
*/
|
|
118
|
+
setGuessRemote(guess: boolean): this;
|
|
119
|
+
/**
|
|
120
|
+
* `--[no-]relative-paths` (git 2.48+, default `worktree.useRelativePaths`): the link files
|
|
121
|
+
* hold relative paths and the repository gets `extensions.relativeWorktrees` (which git
|
|
122
|
+
* before 2.48 refuses: only on request).
|
|
123
|
+
*/
|
|
124
|
+
setRelativePaths(relative: boolean): this;
|
|
125
|
+
/**
|
|
126
|
+
* The git version reproduced (default 2.56). 2.43 has no relative links (the option is
|
|
127
|
+
* refused, `worktree.useRelativePaths` ignored) and takes an ambiguous remote branch name
|
|
128
|
+
* for none.
|
|
129
|
+
*/
|
|
130
|
+
setCompatibility(version: "2.43" | "2.56"): this;
|
|
88
131
|
/** The identity of the reflog lines (default: the repository's `user.name` / `user.email`). */
|
|
89
132
|
setIdent(who: PersonIdent): this;
|
|
90
133
|
call(): Promise<WorktreeAddResult>;
|
|
91
|
-
/**
|
|
134
|
+
/**
|
|
135
|
+
* git's `unique_tracking_name` for `worktree add`: the remote-tracking branch `name` is
|
|
136
|
+
* guessed from, undefined when none; several without `checkout.defaultRemote` die with
|
|
137
|
+
* git's advice (2.5x) or count as none (2.43).
|
|
138
|
+
*/
|
|
139
|
+
private trackingName;
|
|
140
|
+
/**
|
|
141
|
+
* git's `can_use_local_refs`: HEAD resolves, or some branch does (then, unless quiet, the
|
|
142
|
+
* warning that HEAD is invalid).
|
|
143
|
+
*/
|
|
144
|
+
private canUseLocalRefs;
|
|
145
|
+
/**
|
|
146
|
+
* git's `remote_get(NULL)` found a remote: the current branch's `branch.<b>.remote` (any
|
|
147
|
+
* name, git takes one without a section for a URL), else the one configured remote, else
|
|
148
|
+
* `origin`, which must have a URL.
|
|
149
|
+
*/
|
|
150
|
+
private hasDefaultRemote;
|
|
151
|
+
/**
|
|
152
|
+
* git's `dwim_orphan`: no valid HEAD, no branch and (`remote` with --guess-remote) no
|
|
153
|
+
* remote-tracking branch infers `--orphan`; a remote with nothing fetched refuses the add
|
|
154
|
+
* unless forced.
|
|
155
|
+
*/
|
|
92
156
|
private dwimOrphan;
|
|
93
157
|
/** The commit `name` names (`lookup_commit_reference_by_name`), else undefined. */
|
|
94
158
|
private commitOf;
|
|
@@ -98,8 +162,16 @@ export declare class WorktreeAddCommand extends GitCommand<WorktreeAddResult> {
|
|
|
98
162
|
private isBranch;
|
|
99
163
|
/** The identity set, else git's committer ident (environment, configuration). */
|
|
100
164
|
private ident;
|
|
101
|
-
/**
|
|
165
|
+
/**
|
|
166
|
+
* `git branch [--force] [--quiet] <new> <start> [--[no-]track]`, with git's reflog line and
|
|
167
|
+
* the tracking `create_branch` sets up (its message on `output` unless quiet).
|
|
168
|
+
*/
|
|
102
169
|
private createBranch;
|
|
170
|
+
/**
|
|
171
|
+
* A step of git's `git branch` child: its death (`fatal: ...` with hints, whatever their
|
|
172
|
+
* order) becomes a WorktreeError carrying what was printed before.
|
|
173
|
+
*/
|
|
174
|
+
private childStep;
|
|
103
175
|
/** git's `add_worktree`. */
|
|
104
176
|
private addWorktree;
|
|
105
177
|
/** git's `reset --hard --no-recurse-submodules` in the new worktree. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"worktree-add-command.d.ts","sourceRoot":"","sources":["../../src/commands/worktree-add-command.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KA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GAAG,MAAM,GAAG,IAAI,CAI/C;IAED,+FAA+F;IAC/F,QAAQ,CAAC,GAAG,EAAE,WAAW,GAAG,IAAI,CAI/B;IAEK,IAAI,IAAI,OAAO,CAAC,iBAAiB,CAAC,CAuHvC;IAED;;;;OAIG;YACW,YAAY;IAgB1B;;;OAGG;YACW,eAAe;IAa7B;;;;OAIG;YACW,gBAAgB;IAU9B;;;;OAIG;YACW,UAAU;IA8BxB,mFAAmF;YACrE,QAAQ;YASR,MAAM;IAKpB,6CAA6C;YAC/B,aAAa;YAeb,QAAQ;IAItB,iFAAiF;IACjF,OAAO,CAAC,KAAK;IAIb;;;OAGG;YACW,YAAY;IA6C1B;;;OAGG;YACW,SAAS;IAavB,4BAA4B;YACd,WAAW;IA2FzB,wEAAwE;YAC1D,gBAAgB;CAkD/B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"worktree-list-command.d.ts","sourceRoot":"","sources":["../../src/commands/worktree-list-command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAElD,OAAO,KAAK,EAAmB,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAGnF,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAI/C,OAAO,EAAiC,KAAK,cAAc,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"worktree-list-command.d.ts","sourceRoot":"","sources":["../../src/commands/worktree-list-command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAElD,OAAO,KAAK,EAAmB,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAGnF,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAI/C,OAAO,EAAiC,KAAK,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAE3F,kDAAkD;AAClD,MAAM,WAAW,iBAAkB,SAAQ,YAAY;IACrD,mFAAmF;IACnF,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;CAClC;AAED,8CAA8C;AAC9C,MAAM,WAAW,kBAAkB;IACjC,oEAAoE;IACpE,SAAS,EAAE,iBAAiB,EAAE,CAAC;IAC/B,mEAAmE;IACnE,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,0CAA0C;AAC1C,MAAM,MAAM,kBAAkB,GAAG,SAAS,GAAG,SAAS,GAAG,WAAW,CAAC;AAErE;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,qBAAa,mBAAoB,SAAQ,UAAU,CAAC,kBAAkB,CAAC;IACrE,OAAO,CAAC,MAAM,CAAiC;IAC/C,OAAO,CAAC,GAAG,CAAS;IACpB,OAAO,CAAC,MAAM,CAA4C;IAC1D,OAAO,CAAC,aAAa,CAAS;IAE9B,kEAAkE;IAClE,SAAS,CAAC,MAAM,EAAE,kBAAkB,GAAG,IAAI,CAI1C;IAED,4EAA4E;IAC5E,gBAAgB,CAAC,GAAG,EAAE,OAAO,GAAG,IAAI,CAInC;IAED,6FAA6F;IAC7F,SAAS,CAAC,MAAM,EAAE,cAAc,GAAG,IAAI,CAItC;IAED;;;OAGG;IACH,gBAAgB,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAItC;IAEK,IAAI,IAAI,OAAO,CAAC,kBAAkB,CAAC,CAkBxC;YAEa,eAAe;IAU7B,OAAO,CAAC,cAAc;IAItB,uCAAuC;IACvC,OAAO,CAAC,SAAS;IAsBjB,kDAAkD;YACpC,KAAK;CA+BpB;AAYD;;;GAGG;AACH,wBAAsB,qBAAqB,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAcpF"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* git's `verify_path` as checkout, reset, read-tree, merge and clone apply it: the rules of
|
|
3
|
+
* the worktree (Windows paths) and of the configuration (`core.protectNTFS`,
|
|
4
|
+
* `core.protectHFS`), and git's messages for a tree that holds a path it refuses.
|
|
5
|
+
*/
|
|
6
|
+
import { type ObjectId, type WorktreePathOptions } from "@statewalker/vcs-core";
|
|
7
|
+
import type { WorkingCopy, Worktree } from "@statewalker/vcs-working-tree";
|
|
8
|
+
import { EmptyTreeEntryNameError, InvalidPathError } from "../errors/index.js";
|
|
9
|
+
import type { CommandTrees } from "../git-command.js";
|
|
10
|
+
/**
|
|
11
|
+
* The path rules a command applies to the paths a tree gives the index and the worktree:
|
|
12
|
+
* Windows rules on a Windows worktree, `core.protectNTFS` (default true) and
|
|
13
|
+
* `core.protectHFS` (default {@link protectHFSDefault}: on for macOS and for an unknown
|
|
14
|
+
* system, off for a known other one). A worktree that refuses more itself
|
|
15
|
+
* (`capabilities.protects`: `FileWorktree` keeps both on everywhere) raises them, so a
|
|
16
|
+
* command refuses such a path before writing anything rather than halfway through.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```typescript
|
|
20
|
+
* const rules = worktreePathRules(workingCopy, worktree);
|
|
21
|
+
* isValidWorktreePath("git~1/config", undefined, rules); // false unless core.protectNTFS=false
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
export declare function worktreePathRules(workingCopy: WorkingCopy | undefined, worktree?: Worktree): WorktreePathOptions;
|
|
25
|
+
/**
|
|
26
|
+
* What git says of a tree holding a path it refuses, else undefined: walking the tree in its
|
|
27
|
+
* order as unpack-trees adds its entries to the index, the first entry with an empty name
|
|
28
|
+
* (git dies decoding it, {@link EmptyTreeEntryNameError}) or the first file, link or
|
|
29
|
+
* submodule whose full path `verify_path` refuses ({@link InvalidPathError}). Reads the raw
|
|
30
|
+
* trees, so it answers for names the tree decoder refuses (`..`, `/` in a name). One
|
|
31
|
+
* deliberate divergence: a path below a name holding `/` (`c:/temp/x`) is refused here,
|
|
32
|
+
* where git checks it out as nested directories (fsck's `fullPathname` warning); ours never
|
|
33
|
+
* reads such a tree.
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* ```typescript
|
|
37
|
+
* const refusal = await treePathRefusal(trees, treeId, rules);
|
|
38
|
+
* if (refusal) throw refusal; // error: invalid path '../no'
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
export declare function treePathRefusal(trees: CommandTrees, treeId: ObjectId, rules: WorktreePathOptions, prefix?: string, slashed?: boolean): Promise<EmptyTreeEntryNameError | InvalidPathError | undefined>;
|
|
42
|
+
/**
|
|
43
|
+
* Runs `body`; when it fails on a tree name the decoder refuses (`..`, `.`, `/`, an empty
|
|
44
|
+
* name), throws git's refusal for the first of `treeIds` that holds one instead
|
|
45
|
+
* ({@link treePathRefusal}), passed through `wrap` (a command's own lines).
|
|
46
|
+
*/
|
|
47
|
+
export declare function withTreePathRefusal<T>(trees: CommandTrees, treeIds: Array<ObjectId | undefined> | (() => Array<ObjectId | undefined>), rules: WorktreePathOptions, body: () => Promise<T>, wrap?: (refusal: EmptyTreeEntryNameError | InvalidPathError) => Error): Promise<T>;
|
|
48
|
+
/**
|
|
49
|
+
* The first path (in index order) of `target` that `verify_path` refuses among those whose
|
|
50
|
+
* entry is not already `base`'s (the index's entries passed the check when they were added),
|
|
51
|
+
* else undefined: what unpack-trees reports (`invalid path '<path>'`) before it writes anything.
|
|
52
|
+
*
|
|
53
|
+
* @example
|
|
54
|
+
* ```typescript
|
|
55
|
+
* const path = firstInvalidPath(target, index, rules);
|
|
56
|
+
* if (path) return { message: `error: invalid path '${path}'`, paths: [path] };
|
|
57
|
+
* ```
|
|
58
|
+
*/
|
|
59
|
+
export declare function firstInvalidPath(target: ReadonlyMap<string, {
|
|
60
|
+
objectId: ObjectId;
|
|
61
|
+
mode: number;
|
|
62
|
+
}>, base: ReadonlyMap<string, {
|
|
63
|
+
objectId: ObjectId;
|
|
64
|
+
mode: number;
|
|
65
|
+
}>, rules: WorktreePathOptions): string | undefined;
|
|
66
|
+
//# sourceMappingURL=worktree-path-rules.d.ts.map
|
|
@@ -0,0 +1 @@
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E,QAAQ,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,EACjE,IAAI,EAAE,WAAW,CAAC,MAAM,EAAE;IAAE,QAAQ,EAAE,QAAQ,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,EAC/D,KAAK,EAAE,mBAAmB,GACzB,MAAM,GAAG,SAAS,CASpB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type WorktreeInfo } from "@statewalker/vcs-working-tree";
|
|
2
2
|
import { GitCommand } from "../git-command.js";
|
|
3
3
|
/**
|
|
4
4
|
* Remove a linked worktree: its directory and its administrative files.
|
|
@@ -30,7 +30,7 @@ export declare class WorktreeRemoveCommand extends GitCommand<WorktreeInfo> {
|
|
|
30
30
|
/**
|
|
31
31
|
* Move a linked worktree.
|
|
32
32
|
*
|
|
33
|
-
* Equivalent to `git worktree move [-f] <worktree> <new-path>`.
|
|
33
|
+
* Equivalent to `git worktree move [-f] [--[no-]relative-paths] <worktree> <new-path>`.
|
|
34
34
|
*
|
|
35
35
|
* @example
|
|
36
36
|
* ```typescript
|
|
@@ -42,12 +42,19 @@ export declare class WorktreeRemoveCommand extends GitCommand<WorktreeInfo> {
|
|
|
42
42
|
* not an empty directory, or where a missing worktree is registered (unless forced);
|
|
43
43
|
* submodules; a locked worktree unless forced twice; a worktree whose `.git` file does not
|
|
44
44
|
* point back; a worktree beyond this storage. The directory is renamed, then `gitdir` and the worktree's `.git` file name
|
|
45
|
-
* the new place.
|
|
45
|
+
* the new place: absolute paths, or relative ones with {@link setRelativePaths} (git 2.48+,
|
|
46
|
+
* default `worktree.useRelativePaths`; the repository then gets `extensions.relativeWorktrees`).
|
|
46
47
|
*/
|
|
47
48
|
export declare class WorktreeMoveCommand extends GitCommand<WorktreeInfo> {
|
|
48
49
|
private worktree?;
|
|
49
50
|
private destination?;
|
|
50
51
|
private force;
|
|
52
|
+
private relativePaths?;
|
|
53
|
+
private compatibility;
|
|
54
|
+
/** `--[no-]relative-paths` (git 2.48+; default `worktree.useRelativePaths`). */
|
|
55
|
+
setRelativePaths(relative: boolean): this;
|
|
56
|
+
/** The git version reproduced (default 2.56): 2.43 has no relative links. */
|
|
57
|
+
setCompatibility(version: "2.43" | "2.56"): this;
|
|
51
58
|
/** The worktree: a path, or a unique suffix of one. */
|
|
52
59
|
setWorktree(worktree: string): this;
|
|
53
60
|
/** `<new-path>`. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"worktree-remove-command.d.ts","sourceRoot":"","sources":["../../src/commands/worktree-remove-command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"worktree-remove-command.d.ts","sourceRoot":"","sources":["../../src/commands/worktree-remove-command.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,YAAY,EAClB,MAAM,+BAA+B,CAAC;AAGvC,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAoC/C;;;;;;;;;;;;;;;;;GAiBG;AACH,qBAAa,qBAAsB,SAAQ,UAAU,CAAC,YAAY,CAAC;IACjE,OAAO,CAAC,QAAQ,CAAC,CAAS;IAC1B,OAAO,CAAC,KAAK,CAAK;IAElB,uDAAuD;IACvD,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAIlC;IAED,gFAAgF;IAChF,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAItC;IAEK,IAAI,IAAI,OAAO,CAAC,YAAY,CAAC,CAyClC;CACF;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,qBAAa,mBAAoB,SAAQ,UAAU,CAAC,YAAY,CAAC;IAC/D,OAAO,CAAC,QAAQ,CAAC,CAAS;IAC1B,OAAO,CAAC,WAAW,CAAC,CAAS;IAC7B,OAAO,CAAC,KAAK,CAAK;IAClB,OAAO,CAAC,aAAa,CAAC,CAAU;IAChC,OAAO,CAAC,aAAa,CAA2B;IAEhD,gFAAgF;IAChF,gBAAgB,CAAC,QAAQ,EAAE,OAAO,GAAG,IAAI,CAIxC;IAED,6EAA6E;IAC7E,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAI/C;IAED,uDAAuD;IACvD,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAIlC;IAED,oBAAoB;IACpB,cAAc,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAIxC;IAED,8DAA8D;IAC9D,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAItC;IAEK,IAAI,IAAI,OAAO,CAAC,YAAY,CAAC,CAmClC;CACF"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type WorktreeRepairReport } from "@statewalker/vcs-working-tree";
|
|
2
2
|
import { GitCommand } from "../git-command.js";
|
|
3
3
|
/** What {@link WorktreeRepairCommand} found and fixed. */
|
|
4
4
|
export interface WorktreeRepairResult {
|
|
@@ -12,7 +12,7 @@ export interface WorktreeRepairResult {
|
|
|
12
12
|
/**
|
|
13
13
|
* Repair the links between worktrees and the repository.
|
|
14
14
|
*
|
|
15
|
-
* Equivalent to `git worktree repair [<path>...]`.
|
|
15
|
+
* Equivalent to `git worktree repair [--[no-]relative-paths] [<path>...]`.
|
|
16
16
|
*
|
|
17
17
|
* @example
|
|
18
18
|
* ```typescript
|
|
@@ -25,9 +25,22 @@ export interface WorktreeRepairResult {
|
|
|
25
25
|
* copy of the repository is pointed at this one. Then every linked worktree's `.git` file
|
|
26
26
|
* is rewritten when broken or not pointing back (`.git file broken`, `.git file
|
|
27
27
|
* incorrect`). A worktree that cannot be located is reported as an error.
|
|
28
|
+
*
|
|
29
|
+
* As git 2.48+, both link files are rewritten together, absolute or relative as
|
|
30
|
+
* {@link setRelativePaths} (default `worktree.useRelativePaths`, false) says, and links of the
|
|
31
|
+
* other kind are repaired too (`gitdir absolute/relative path mismatch`, `.git file
|
|
32
|
+
* absolute/relative path mismatch`): a repair without the option turns relative links back
|
|
33
|
+
* into absolute ones. Under 2.43 ({@link setCompatibility}) only the file at fault is
|
|
34
|
+
* rewritten.
|
|
28
35
|
*/
|
|
29
36
|
export declare class WorktreeRepairCommand extends GitCommand<WorktreeRepairResult> {
|
|
30
37
|
private paths;
|
|
38
|
+
private relativePaths?;
|
|
39
|
+
private compatibility;
|
|
40
|
+
/** `--[no-]relative-paths` (git 2.48+; default `worktree.useRelativePaths`). */
|
|
41
|
+
setRelativePaths(relative: boolean): this;
|
|
42
|
+
/** The git version reproduced (default 2.56): 2.43 rewrites only the file at fault. */
|
|
43
|
+
setCompatibility(version: "2.43" | "2.56"): this;
|
|
31
44
|
/** A worktree path whose back-link to check. */
|
|
32
45
|
addPath(path: string): this;
|
|
33
46
|
call(): Promise<WorktreeRepairResult>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"worktree-repair-command.d.ts","sourceRoot":"","sources":["../../src/commands/worktree-repair-command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"worktree-repair-command.d.ts","sourceRoot":"","sources":["../../src/commands/worktree-repair-command.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,oBAAoB,EAC1B,MAAM,+BAA+B,CAAC;AAIvC,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAO/C,0DAA0D;AAC1D,MAAM,WAAW,oBAAoB;IACnC,4CAA4C;IAC5C,OAAO,EAAE,oBAAoB,EAAE,CAAC;IAChC,0FAA0F;IAC1F,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,2CAA2C;IAC3C,EAAE,EAAE,OAAO,CAAC;CACb;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,qBAAa,qBAAsB,SAAQ,UAAU,CAAC,oBAAoB,CAAC;IACzE,OAAO,CAAC,KAAK,CAAgB;IAC7B,OAAO,CAAC,aAAa,CAAC,CAAU;IAChC,OAAO,CAAC,aAAa,CAA2B;IAEhD,gFAAgF;IAChF,gBAAgB,CAAC,QAAQ,EAAE,OAAO,GAAG,IAAI,CAIxC;IAED,uFAAuF;IACvF,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAI/C;IAED,gDAAgD;IAChD,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAI1B;IAEK,IAAI,IAAI,OAAO,CAAC,oBAAoB,CAAC,CA8B1C;CACF"}
|
|
@@ -6,6 +6,11 @@
|
|
|
6
6
|
* @module
|
|
7
7
|
*/
|
|
8
8
|
import type { LinkedWorktrees, WorkingCopy, WorktreeAdmin, WorktreeInfo } from "@statewalker/vcs-working-tree";
|
|
9
|
+
/**
|
|
10
|
+
* Whether `worktree move`/`repair` write relative links: the option, else
|
|
11
|
+
* `worktree.useRelativePaths` (false). git 2.43 has neither: the option is refused there.
|
|
12
|
+
*/
|
|
13
|
+
export declare function useRelativePaths(workingCopy: WorkingCopy, option: boolean | undefined, compatibility: "2.43" | "2.56"): boolean;
|
|
9
14
|
/**
|
|
10
15
|
* A working copy for the `git worktree` commands from a {@link WorktreeAdmin}: the admin's
|
|
11
16
|
* working copy when it has one, else (a bare repository) its history, configuration and
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"worktree-support.d.ts","sourceRoot":"","sources":["../../src/commands/worktree-support.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;
|
|
1
|
+
{"version":3,"file":"worktree-support.d.ts","sourceRoot":"","sources":["../../src/commands/worktree-support.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EACV,eAAe,EACf,WAAW,EACX,aAAa,EACb,YAAY,EACb,MAAM,+BAA+B,CAAC;AAQvC;;;GAGG;AACH,wBAAgB,gBAAgB,CAC9B,WAAW,EAAE,WAAW,EACxB,MAAM,EAAE,OAAO,GAAG,SAAS,EAC3B,aAAa,EAAE,MAAM,GAAG,M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