git-chopstick-core 0.1.1 → 0.1.3
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 +324 -32
- package/dist/git/add.d.ts +9 -0
- package/dist/git/add.js +11 -0
- package/dist/git/add.js.map +1 -0
- package/dist/git/apply.d.ts +33 -0
- package/dist/git/apply.js +103 -0
- package/dist/git/apply.js.map +1 -0
- package/dist/git/authentication.d.ts +5 -0
- package/dist/git/authentication.js +19 -0
- package/dist/git/authentication.js.map +1 -0
- package/dist/git/branch.d.ts +43 -0
- package/dist/git/branch.js +150 -0
- package/dist/git/branch.js.map +1 -0
- package/dist/git/checkout-index.d.ts +19 -0
- package/{src/git/checkout-index.ts → dist/git/checkout-index.js} +11 -22
- package/dist/git/checkout-index.js.map +1 -0
- package/dist/git/checkout.d.ts +46 -0
- package/dist/git/checkout.js +126 -0
- package/dist/git/checkout.js.map +1 -0
- package/dist/git/cherry-pick.d.ts +82 -0
- package/dist/git/cherry-pick.js +371 -0
- package/dist/git/cherry-pick.js.map +1 -0
- package/dist/git/clean.d.ts +5 -0
- package/dist/git/clean.js +8 -0
- package/dist/git/clean.js.map +1 -0
- package/dist/git/clone.d.ts +22 -0
- package/dist/git/clone.js +58 -0
- package/dist/git/clone.js.map +1 -0
- package/dist/git/coerce-to-buffer.d.ts +1 -0
- package/dist/git/coerce-to-buffer.js +2 -0
- package/dist/git/coerce-to-buffer.js.map +1 -0
- package/dist/git/coerce-to-string.d.ts +1 -0
- package/dist/git/coerce-to-string.js +2 -0
- package/dist/git/coerce-to-string.js.map +1 -0
- package/dist/git/commit.d.ts +25 -0
- package/dist/git/commit.js +99 -0
- package/dist/git/commit.js.map +1 -0
- package/dist/git/config.d.ts +98 -0
- package/dist/git/config.js +249 -0
- package/dist/git/config.js.map +1 -0
- package/dist/git/core.d.ts +167 -0
- package/dist/git/core.js +368 -0
- package/dist/git/core.js.map +1 -0
- package/dist/git/create-tail-stream.d.ts +4 -0
- package/dist/git/create-tail-stream.js +30 -0
- package/dist/git/create-tail-stream.js.map +1 -0
- package/dist/git/credential.d.ts +5 -0
- package/dist/git/credential.js +64 -0
- package/dist/git/credential.js.map +1 -0
- package/dist/git/description.d.ts +5 -0
- package/dist/git/description.js +24 -0
- package/dist/git/description.js.map +1 -0
- package/dist/git/diff-check.d.ts +7 -0
- package/dist/git/diff-check.js +17 -0
- package/dist/git/diff-check.js.map +1 -0
- package/dist/git/diff-index.d.ts +31 -0
- package/dist/git/diff-index.js +76 -0
- package/dist/git/diff-index.js.map +1 -0
- package/dist/git/diff.d.ts +81 -0
- package/dist/git/diff.js +611 -0
- package/dist/git/diff.js.map +1 -0
- package/dist/git/environment.d.ts +51 -0
- package/dist/git/environment.js +97 -0
- package/dist/git/environment.js.map +1 -0
- package/dist/git/exec.d.ts +109 -0
- package/dist/git/exec.js +224 -0
- package/dist/git/exec.js.map +1 -0
- package/dist/git/fetch.d.ts +25 -0
- package/dist/git/fetch.js +100 -0
- package/dist/git/fetch.js.map +1 -0
- package/dist/git/for-each-ref.d.ts +13 -0
- package/dist/git/for-each-ref.js +114 -0
- package/dist/git/for-each-ref.js.map +1 -0
- package/dist/git/format-patch.d.ts +10 -0
- package/dist/git/format-patch.js +16 -0
- package/dist/git/format-patch.js.map +1 -0
- package/dist/git/git-delimiter-parser.d.ts +38 -0
- package/dist/git/git-delimiter-parser.js +79 -0
- package/dist/git/git-delimiter-parser.js.map +1 -0
- package/dist/git/gitignore.d.ts +26 -0
- package/dist/git/gitignore.js +124 -0
- package/dist/git/gitignore.js.map +1 -0
- package/dist/git/index.d.ts +46 -0
- package/dist/git/index.js +47 -0
- package/dist/git/index.js.map +1 -0
- package/dist/git/init.d.ts +2 -0
- package/dist/git/init.js +7 -0
- package/dist/git/init.js.map +1 -0
- package/{src/git/interpret-trailers.ts → dist/git/interpret-trailers.d.ts} +9 -97
- package/dist/git/interpret-trailers.js +130 -0
- package/dist/git/interpret-trailers.js.map +1 -0
- package/dist/git/lfs.d.ts +25 -0
- package/dist/git/lfs.js +73 -0
- package/dist/git/lfs.js.map +1 -0
- package/dist/git/log.d.ts +56 -0
- package/dist/git/log.js +258 -0
- package/dist/git/log.js.map +1 -0
- package/dist/git/merge-tree.d.ts +13 -0
- package/dist/git/merge-tree.js +24 -0
- package/dist/git/merge-tree.js.map +1 -0
- package/dist/git/merge.d.ts +50 -0
- package/dist/git/merge.js +111 -0
- package/dist/git/merge.js.map +1 -0
- package/dist/git/multi-operation-terminal-output.d.ts +20 -0
- package/dist/git/multi-operation-terminal-output.js +56 -0
- package/dist/git/multi-operation-terminal-output.js.map +1 -0
- package/dist/git/pull.d.ts +24 -0
- package/dist/git/pull.js +91 -0
- package/dist/git/pull.js.map +1 -0
- package/{src/git/push-terminal-chunk.ts → dist/git/push-terminal-chunk.d.ts} +1 -23
- package/dist/git/push-terminal-chunk.js +36 -0
- package/dist/git/push-terminal-chunk.js.map +1 -0
- package/dist/git/push.d.ts +42 -0
- package/dist/git/push.js +80 -0
- package/dist/git/push.js.map +1 -0
- package/dist/git/rebase.d.ts +119 -0
- package/dist/git/rebase.js +415 -0
- package/dist/git/rebase.js.map +1 -0
- package/dist/git/reflog.d.ts +14 -0
- package/dist/git/reflog.js +88 -0
- package/dist/git/reflog.js.map +1 -0
- package/dist/git/refs.d.ts +26 -0
- package/dist/git/refs.js +53 -0
- package/dist/git/refs.js.map +1 -0
- package/dist/git/remote.d.ts +31 -0
- package/dist/git/remote.js +81 -0
- package/dist/git/remote.js.map +1 -0
- package/dist/git/reorder.d.ts +23 -0
- package/dist/git/reorder.js +111 -0
- package/dist/git/reorder.js.map +1 -0
- package/dist/git/reset.d.ts +41 -0
- package/dist/git/reset.js +86 -0
- package/dist/git/reset.js.map +1 -0
- package/dist/git/rev-list.d.ts +67 -0
- package/dist/git/rev-list.js +157 -0
- package/dist/git/rev-list.js.map +1 -0
- package/dist/git/rev-parse.d.ts +24 -0
- package/dist/git/rev-parse.js +65 -0
- package/dist/git/rev-parse.js.map +1 -0
- package/dist/git/revert.d.ts +12 -0
- package/dist/git/revert.js +30 -0
- package/dist/git/revert.js.map +1 -0
- package/dist/git/rm.d.ts +12 -0
- package/dist/git/rm.js +22 -0
- package/dist/git/rm.js.map +1 -0
- package/dist/git/show.d.ts +42 -0
- package/{src/git/show.ts → dist/git/show.js} +17 -46
- package/dist/git/show.js.map +1 -0
- package/dist/git/spawn.d.ts +18 -0
- package/dist/git/spawn.js +16 -0
- package/dist/git/spawn.js.map +1 -0
- package/dist/git/squash.d.ts +28 -0
- package/dist/git/squash.js +127 -0
- package/dist/git/squash.js.map +1 -0
- package/dist/git/stage.d.ts +21 -0
- package/dist/git/stage.js +72 -0
- package/dist/git/stage.js.map +1 -0
- package/dist/git/stash.d.ts +53 -0
- package/dist/git/stash.js +204 -0
- package/dist/git/stash.js.map +1 -0
- package/dist/git/status.d.ts +39 -0
- package/dist/git/status.js +293 -0
- package/dist/git/status.js.map +1 -0
- package/dist/git/submodule.d.ts +20 -0
- package/dist/git/submodule.js +153 -0
- package/dist/git/submodule.js.map +1 -0
- package/dist/git/tag.d.ts +32 -0
- package/dist/git/tag.js +101 -0
- package/dist/git/tag.js.map +1 -0
- package/dist/git/update-index.d.ts +11 -0
- package/dist/git/update-index.js +99 -0
- package/dist/git/update-index.js.map +1 -0
- package/dist/git/update-ref.d.ts +23 -0
- package/{src/git/update-ref.ts → dist/git/update-ref.js} +10 -28
- package/dist/git/update-ref.js.map +1 -0
- package/dist/git/var.d.ts +18 -0
- package/{src/git/var.ts → dist/git/var.js} +16 -25
- package/dist/git/var.js.map +1 -0
- package/dist/git/worktree-include.d.ts +42 -0
- package/dist/git/worktree-include.js +109 -0
- package/dist/git/worktree-include.js.map +1 -0
- package/dist/git/worktree.d.ts +25 -0
- package/dist/git/worktree.js +139 -0
- package/dist/git/worktree.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/api.d.ts +2 -0
- package/dist/lib/api.js +7 -0
- package/dist/lib/api.js.map +1 -0
- package/dist/lib/diff-parser.d.ts +20 -0
- package/dist/lib/diff-parser.js +184 -0
- package/dist/lib/diff-parser.js.map +1 -0
- package/dist/lib/directory-exists.d.ts +1 -0
- package/dist/lib/directory-exists.js +11 -0
- package/dist/lib/directory-exists.js.map +1 -0
- package/dist/lib/errno-exception.d.ts +6 -0
- package/dist/lib/errno-exception.js +6 -0
- package/dist/lib/errno-exception.js.map +1 -0
- package/dist/lib/fatal-error.d.ts +4 -0
- package/dist/lib/fatal-error.js +18 -0
- package/dist/lib/fatal-error.js.map +1 -0
- package/dist/lib/feature-flag.d.ts +14 -0
- package/dist/lib/feature-flag.js +25 -0
- package/dist/lib/feature-flag.js.map +1 -0
- package/dist/lib/file-system.d.ts +1 -0
- package/dist/lib/file-system.js +7 -0
- package/dist/lib/file-system.js.map +1 -0
- package/dist/lib/get-old-path.d.ts +2 -0
- package/dist/lib/get-old-path.js +9 -0
- package/dist/lib/get-old-path.js.map +1 -0
- package/dist/lib/git/environment.d.ts +3 -0
- package/dist/lib/git/environment.js +7 -0
- package/dist/lib/git/environment.js.map +1 -0
- package/dist/lib/git-perf.d.ts +1 -0
- package/dist/lib/git-perf.js +4 -0
- package/dist/lib/git-perf.js.map +1 -0
- package/dist/lib/helpers/default-branch.d.ts +1 -0
- package/dist/lib/helpers/default-branch.js +4 -0
- package/dist/lib/helpers/default-branch.js.map +1 -0
- package/dist/lib/helpers/path.d.ts +1 -0
- package/dist/lib/helpers/path.js +5 -0
- package/dist/lib/helpers/path.js.map +1 -0
- package/dist/lib/hooks/with-hooks-env.d.ts +3 -0
- package/dist/lib/hooks/with-hooks-env.js +4 -0
- package/dist/lib/hooks/with-hooks-env.js.map +1 -0
- package/dist/lib/merge.d.ts +1 -0
- package/dist/lib/merge.js +4 -0
- package/dist/lib/merge.js.map +1 -0
- package/dist/lib/noop.d.ts +1 -0
- package/dist/lib/noop.js +2 -0
- package/dist/lib/noop.js.map +1 -0
- package/dist/lib/patch-formatter.d.ts +5 -0
- package/dist/lib/patch-formatter.js +7 -0
- package/dist/lib/patch-formatter.js.map +1 -0
- package/dist/lib/path-exists.d.ts +1 -0
- package/dist/lib/path-exists.js +3 -0
- package/dist/lib/path-exists.js.map +1 -0
- package/dist/lib/progress/from-process.d.ts +2 -0
- package/dist/lib/progress/from-process.js +4 -0
- package/dist/lib/progress/from-process.js.map +1 -0
- package/dist/lib/progress/index.d.ts +49 -0
- package/dist/lib/progress/index.js +32 -0
- package/dist/lib/progress/index.js.map +1 -0
- package/dist/lib/progress/revert.d.ts +8 -0
- package/dist/lib/progress/revert.js +15 -0
- package/dist/lib/progress/revert.js.map +1 -0
- package/dist/lib/rebase.d.ts +1 -0
- package/dist/lib/rebase.js +4 -0
- package/dist/lib/rebase.js.map +1 -0
- package/dist/lib/remove-remote-prefix.d.ts +1 -0
- package/dist/lib/remove-remote-prefix.js +5 -0
- package/dist/lib/remove-remote-prefix.js.map +1 -0
- package/dist/lib/resolve-git-proxy.d.ts +1 -0
- package/dist/lib/resolve-git-proxy.js +4 -0
- package/dist/lib/resolve-git-proxy.js.map +1 -0
- package/dist/lib/round.d.ts +1 -0
- package/dist/lib/round.js +5 -0
- package/dist/lib/round.js.map +1 -0
- package/dist/lib/split-buffer.d.ts +1 -0
- package/dist/lib/split-buffer.js +15 -0
- package/dist/lib/split-buffer.js.map +1 -0
- package/dist/lib/status-parser.d.ts +19 -0
- package/dist/lib/status-parser.js +125 -0
- package/dist/lib/status-parser.js.map +1 -0
- package/dist/lib/stores/helpers/find-default-remote.d.ts +1 -0
- package/dist/lib/stores/helpers/find-default-remote.js +4 -0
- package/dist/lib/stores/helpers/find-default-remote.js.map +1 -0
- package/dist/lib/trampoline/trampoline-environment.d.ts +1 -0
- package/dist/lib/trampoline/trampoline-environment.js +4 -0
- package/dist/lib/trampoline/trampoline-environment.js.map +1 -0
- package/dist/models/branch.d.ts +44 -0
- package/dist/models/branch.js +59 -0
- package/dist/models/branch.js.map +1 -0
- package/dist/models/cherry-pick.d.ts +11 -0
- package/dist/models/cherry-pick.js +2 -0
- package/dist/models/cherry-pick.js.map +1 -0
- package/dist/models/clone-options.d.ts +6 -0
- package/dist/models/clone-options.js +2 -0
- package/dist/models/clone-options.js.map +1 -0
- package/dist/models/commit-identity.d.ts +9 -0
- package/dist/models/commit-identity.js +34 -0
- package/dist/models/commit-identity.js.map +1 -0
- package/dist/models/commit.d.ts +30 -0
- package/dist/models/commit.js +32 -0
- package/dist/models/commit.js.map +1 -0
- package/dist/models/computed-action.d.ts +6 -0
- package/dist/models/computed-action.js +8 -0
- package/dist/models/computed-action.js.map +1 -0
- package/dist/models/diff/diff-data.d.ts +53 -0
- package/dist/models/diff/diff-data.js +19 -0
- package/dist/models/diff/diff-data.js.map +1 -0
- package/dist/models/diff/diff-line.d.ts +18 -0
- package/dist/models/diff/diff-line.js +33 -0
- package/dist/models/diff/diff-line.js.map +1 -0
- package/dist/models/diff/diff-selection.d.ts +22 -0
- package/dist/models/diff/diff-selection.js +127 -0
- package/dist/models/diff/diff-selection.js.map +1 -0
- package/dist/models/diff/image-diff.d.ts +6 -0
- package/dist/models/diff/image-diff.js +8 -0
- package/dist/models/diff/image-diff.js.map +1 -0
- package/dist/models/diff/image.d.ts +7 -0
- package/dist/models/diff/image.js +13 -0
- package/dist/models/diff/image.js.map +1 -0
- package/dist/models/diff/index.d.ts +6 -0
- package/dist/models/diff/index.js +7 -0
- package/dist/models/diff/index.js.map +1 -0
- package/dist/models/diff/raw-diff.d.ts +32 -0
- package/dist/models/diff/raw-diff.js +38 -0
- package/dist/models/diff/raw-diff.js.map +1 -0
- package/dist/models/git-author.d.ts +7 -0
- package/dist/models/git-author.js +18 -0
- package/dist/models/git-author.js.map +1 -0
- package/dist/models/index.d.ts +21 -0
- package/dist/models/index.js +20 -0
- package/dist/models/index.js.map +1 -0
- package/dist/models/manual-conflict-resolution.d.ts +4 -0
- package/dist/models/manual-conflict-resolution.js +6 -0
- package/dist/models/manual-conflict-resolution.js.map +1 -0
- package/dist/models/merge.d.ts +6 -0
- package/dist/models/merge.js +2 -0
- package/dist/models/merge.js.map +1 -0
- package/dist/models/multi-commit-operation.d.ts +6 -0
- package/dist/models/multi-commit-operation.js +8 -0
- package/dist/models/multi-commit-operation.js.map +1 -0
- package/dist/models/progress.d.ts +41 -0
- package/dist/models/progress.js +7 -0
- package/dist/models/progress.js.map +1 -0
- package/dist/models/rebase.d.ts +17 -0
- package/dist/models/rebase.js +8 -0
- package/dist/models/rebase.js.map +1 -0
- package/dist/models/remote.d.ts +5 -0
- package/dist/models/remote.js +8 -0
- package/dist/models/remote.js.map +1 -0
- package/dist/models/repository.d.ts +7 -0
- package/dist/models/repository.js +15 -0
- package/dist/models/repository.js.map +1 -0
- package/dist/models/stash-entry.d.ts +20 -0
- package/dist/models/stash-entry.js +7 -0
- package/dist/models/stash-entry.js.map +1 -0
- package/dist/models/status.d.ts +166 -0
- package/dist/models/status.js +135 -0
- package/dist/models/status.js.map +1 -0
- package/dist/models/submodule.d.ts +12 -0
- package/dist/models/submodule.js +2 -0
- package/dist/models/submodule.js.map +1 -0
- package/dist/models/worktree.d.ts +10 -0
- package/dist/models/worktree.js +2 -0
- package/dist/models/worktree.js.map +1 -0
- package/package.json +44 -5
- package/examples/get-status.ts +0 -84
- package/src/git/add.ts +0 -16
- package/src/git/apply.ts +0 -154
- package/src/git/authentication.ts +0 -19
- package/src/git/branch.ts +0 -206
- package/src/git/checkout.ts +0 -235
- package/src/git/cherry-pick.ts +0 -504
- package/src/git/clean.ts +0 -9
- package/src/git/clone.ts +0 -86
- package/src/git/coerce-to-buffer.ts +0 -4
- package/src/git/coerce-to-string.ts +0 -4
- package/src/git/commit.ts +0 -136
- package/src/git/config.ts +0 -392
- package/src/git/core.ts +0 -625
- package/src/git/create-tail-stream.ts +0 -36
- package/src/git/credential.ts +0 -83
- package/src/git/description.ts +0 -33
- package/src/git/diff-check.ts +0 -27
- package/src/git/diff-index.ts +0 -116
- package/src/git/diff.ts +0 -880
- package/src/git/environment.ts +0 -116
- package/src/git/exec.ts +0 -285
- package/src/git/fetch.ts +0 -141
- package/src/git/for-each-ref.ts +0 -160
- package/src/git/format-patch.ts +0 -17
- package/src/git/git-delimiter-parser.ts +0 -95
- package/src/git/gitignore.ts +0 -157
- package/src/git/index.ts +0 -36
- package/src/git/init.ts +0 -11
- package/src/git/lfs.ts +0 -100
- package/src/git/log.ts +0 -376
- package/src/git/merge-tree.ts +0 -42
- package/src/git/merge.ts +0 -154
- package/src/git/multi-operation-terminal-output.ts +0 -68
- package/src/git/pull.ts +0 -130
- package/src/git/push.ts +0 -119
- package/src/git/rebase.ts +0 -627
- package/src/git/reflog.ts +0 -127
- package/src/git/refs.ts +0 -63
- package/src/git/remote.ts +0 -143
- package/src/git/reorder.ts +0 -153
- package/src/git/reset.ts +0 -101
- package/src/git/rev-list.ts +0 -201
- package/src/git/rev-parse.ts +0 -92
- package/src/git/revert.ts +0 -55
- package/src/git/rm.ts +0 -31
- package/src/git/spawn.ts +0 -38
- package/src/git/squash.ts +0 -173
- package/src/git/stage.ts +0 -97
- package/src/git/stash.ts +0 -302
- package/src/git/status.ts +0 -502
- package/src/git/submodule.ts +0 -212
- package/src/git/tag.ts +0 -134
- package/src/git/update-index.ts +0 -169
- package/src/git/worktree-include.ts +0 -146
- package/src/git/worktree.ts +0 -219
- package/src/index.ts +0 -23
- package/src/lib/api.ts +0 -7
- package/src/lib/diff-parser.ts +0 -249
- package/src/lib/directory-exists.ts +0 -10
- package/src/lib/errno-exception.ts +0 -12
- package/src/lib/fatal-error.ts +0 -23
- package/src/lib/feature-flag.ts +0 -29
- package/src/lib/file-system.ts +0 -7
- package/src/lib/get-old-path.ts +0 -11
- package/src/lib/git/environment.ts +0 -14
- package/src/lib/git-perf.ts +0 -3
- package/src/lib/helpers/default-branch.ts +0 -3
- package/src/lib/helpers/path.ts +0 -5
- package/src/lib/hooks/with-hooks-env.ts +0 -7
- package/src/lib/merge.ts +0 -3
- package/src/lib/noop.ts +0 -1
- package/src/lib/patch-formatter.ts +0 -18
- package/src/lib/path-exists.ts +0 -7
- package/src/lib/progress/from-process.ts +0 -10
- package/src/lib/progress/index.ts +0 -43
- package/src/lib/progress/revert.ts +0 -17
- package/src/lib/rebase.ts +0 -3
- package/src/lib/remove-remote-prefix.ts +0 -4
- package/src/lib/resolve-git-proxy.ts +0 -3
- package/src/lib/round.ts +0 -4
- package/src/lib/split-buffer.ts +0 -14
- package/src/lib/status-parser.ts +0 -188
- package/src/lib/stores/helpers/find-default-remote.ts +0 -3
- package/src/lib/trampoline/trampoline-environment.ts +0 -8
- package/src/models/branch.ts +0 -78
- package/src/models/cherry-pick.ts +0 -12
- package/src/models/clone-options.ts +0 -6
- package/src/models/commit-identity.ts +0 -35
- package/src/models/commit.ts +0 -44
- package/src/models/computed-action.ts +0 -6
- package/src/models/diff/diff-data.ts +0 -78
- package/src/models/diff/diff-line.ts +0 -36
- package/src/models/diff/diff-selection.ts +0 -165
- package/src/models/diff/image-diff.ts +0 -6
- package/src/models/diff/image.ts +0 -8
- package/src/models/diff/index.ts +0 -6
- package/src/models/diff/raw-diff.ts +0 -41
- package/src/models/git-author.ts +0 -16
- package/src/models/manual-conflict-resolution.ts +0 -4
- package/src/models/merge.ts +0 -6
- package/src/models/multi-commit-operation.ts +0 -6
- package/src/models/progress.ts +0 -67
- package/src/models/rebase.ts +0 -20
- package/src/models/remote.ts +0 -10
- package/src/models/repository.ts +0 -16
- package/src/models/stash-entry.ts +0 -25
- package/src/models/status.ts +0 -275
- package/src/models/submodule.ts +0 -13
- package/src/models/worktree.ts +0 -11
- package/tsconfig.json +0 -17
package/dist/git/pull.js
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { git, gitRebaseArguments, } from './core.js';
|
|
2
|
+
import { PullProgressParser, executionOptionsWithProgress } from '../lib/progress/index.js';
|
|
3
|
+
import { envForRemoteOperation } from './environment.js';
|
|
4
|
+
import { getConfigValue } from './config.js';
|
|
5
|
+
/**
|
|
6
|
+
* Pull from the specified remote.
|
|
7
|
+
*
|
|
8
|
+
* @param repository - The repository in which the pull should take place
|
|
9
|
+
*
|
|
10
|
+
* @param remote - The name of the remote that should be pulled from
|
|
11
|
+
*
|
|
12
|
+
* @param progressCallback - An optional function which will be invoked
|
|
13
|
+
* with information about the current progress
|
|
14
|
+
* of the pull operation. When provided this enables
|
|
15
|
+
* the '--progress' command line flag for
|
|
16
|
+
* 'git pull'.
|
|
17
|
+
*/
|
|
18
|
+
export async function pull(repository, remote, options) {
|
|
19
|
+
let opts = {
|
|
20
|
+
env: await envForRemoteOperation(remote.url),
|
|
21
|
+
// git pull triggers merge or rebase hooks depending on config, instead of
|
|
22
|
+
// trying to check pull.rebase and friends we'll just intercept all possible
|
|
23
|
+
// hooks that could be run as part of a pull operation.
|
|
24
|
+
interceptHooks: [
|
|
25
|
+
'pre-merge-commit',
|
|
26
|
+
'prepare-commit-msg',
|
|
27
|
+
'commit-msg',
|
|
28
|
+
'post-merge',
|
|
29
|
+
'pre-rebase',
|
|
30
|
+
'pre-commit',
|
|
31
|
+
'post-rewrite',
|
|
32
|
+
],
|
|
33
|
+
};
|
|
34
|
+
if (options?.progressCallback) {
|
|
35
|
+
const title = `Pulling ${remote.name}`;
|
|
36
|
+
const kind = 'pull';
|
|
37
|
+
opts = await executionOptionsWithProgress({ ...opts, trackLFSProgress: true }, new PullProgressParser(), progress => {
|
|
38
|
+
// In addition to progress output from the remote end and from
|
|
39
|
+
// git itself, the stderr output from pull contains information
|
|
40
|
+
// about ref updates. We don't need to bring those into the progress
|
|
41
|
+
// stream so we'll just punt on anything we don't know about for now.
|
|
42
|
+
if (progress.kind === 'context') {
|
|
43
|
+
if (!progress.text.startsWith('remote: Counting objects')) {
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
const description = progress.kind === 'progress' ? progress.details.text : progress.text;
|
|
48
|
+
const value = progress.percent;
|
|
49
|
+
options?.progressCallback?.({
|
|
50
|
+
kind,
|
|
51
|
+
title,
|
|
52
|
+
description,
|
|
53
|
+
value,
|
|
54
|
+
remote: remote.name,
|
|
55
|
+
});
|
|
56
|
+
});
|
|
57
|
+
// Initial progress
|
|
58
|
+
options.progressCallback({ kind, title, value: 0, remote: remote.name });
|
|
59
|
+
}
|
|
60
|
+
const args = [
|
|
61
|
+
...gitRebaseArguments(),
|
|
62
|
+
'pull',
|
|
63
|
+
...(await getDefaultPullDivergentBranchArguments(repository)),
|
|
64
|
+
'--recurse-submodules',
|
|
65
|
+
...(options?.progressCallback ? ['--progress'] : []),
|
|
66
|
+
...(options?.noVerify ? ['--no-verify'] : []),
|
|
67
|
+
remote.name,
|
|
68
|
+
];
|
|
69
|
+
await git(args, repository.path, 'pull', opts);
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Defaults the pull default for divergent paths to try to fast forward and if
|
|
73
|
+
* not perform a merge. Aka uses the flag --ff
|
|
74
|
+
*
|
|
75
|
+
* It checks whether the user has a config set for this already, if so, no need for
|
|
76
|
+
* default.
|
|
77
|
+
*/
|
|
78
|
+
async function getDefaultPullDivergentBranchArguments(repository) {
|
|
79
|
+
try {
|
|
80
|
+
const pullFF = await getConfigValue(repository, 'pull.ff');
|
|
81
|
+
return pullFF !== null ? [] : ['--ff'];
|
|
82
|
+
}
|
|
83
|
+
catch (e) {
|
|
84
|
+
console.error("Couldn't read 'pull.ff' config", e);
|
|
85
|
+
}
|
|
86
|
+
// If there is a failure in checking the config, we still want to use any
|
|
87
|
+
// config and not overwrite the user's set config behavior. This will show the
|
|
88
|
+
// git error if no config is set.
|
|
89
|
+
return [];
|
|
90
|
+
}
|
|
91
|
+
//# sourceMappingURL=pull.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pull.js","sourceRoot":"","sources":["../../src/git/pull.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,GAAG,EACH,kBAAkB,GAKnB,MAAM,WAAW,CAAA;AAGlB,OAAO,EA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}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { coerceToString } from './coerce-to-string'
|
|
2
|
-
|
|
3
1
|
/**
|
|
4
2
|
* Appends a chunk of terminal output to a buffer while maintaining a maximum capacity.
|
|
5
3
|
*
|
|
@@ -18,24 +16,4 @@ import { coerceToString } from './coerce-to-string'
|
|
|
18
16
|
* When the buffer exceeds capacity, chunks are removed from the beginning (oldest first),
|
|
19
17
|
* and partial chunks may be trimmed to fit exactly within the capacity limit.
|
|
20
18
|
*/
|
|
21
|
-
export const pushTerminalChunk
|
|
22
|
-
chunks: string[],
|
|
23
|
-
capacity: number,
|
|
24
|
-
chunk: Buffer | string
|
|
25
|
-
) => {
|
|
26
|
-
chunks.push(coerceToString(chunk))
|
|
27
|
-
let terminalOutputLength = chunks.reduce((acc, cur) => acc + cur.length, 0)
|
|
28
|
-
|
|
29
|
-
while (terminalOutputLength > capacity) {
|
|
30
|
-
const firstChunk = chunks[0]
|
|
31
|
-
const overrun = terminalOutputLength - capacity
|
|
32
|
-
|
|
33
|
-
if (overrun >= firstChunk.length) {
|
|
34
|
-
chunks.shift()
|
|
35
|
-
terminalOutputLength -= firstChunk.length
|
|
36
|
-
} else {
|
|
37
|
-
chunks[0] = firstChunk.substring(overrun)
|
|
38
|
-
terminalOutputLength -= overrun
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
}
|
|
19
|
+
export declare const pushTerminalChunk: (chunks: string[], capacity: number, chunk: Buffer | string) => void;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { coerceToString } from './coerce-to-string.js';
|
|
2
|
+
/**
|
|
3
|
+
* Appends a chunk of terminal output to a buffer while maintaining a maximum capacity.
|
|
4
|
+
*
|
|
5
|
+
* This function manages a rolling buffer of terminal output (combined stdout and stderr)
|
|
6
|
+
* by pushing new chunks and trimming from the beginning when the total character count
|
|
7
|
+
* exceeds the specified capacity. This ensures memory-bounded storage of terminal output
|
|
8
|
+
* for git operations.
|
|
9
|
+
*
|
|
10
|
+
* @param chunks - The array of string chunks representing the terminal output buffer.
|
|
11
|
+
* This array is mutated in place.
|
|
12
|
+
* @param capacity - The maximum number of characters to retain in the buffer.
|
|
13
|
+
* Note: this is character count, not byte count.
|
|
14
|
+
* @param chunk - The new chunk of terminal output to append, either as a Buffer or string.
|
|
15
|
+
*
|
|
16
|
+
* Intended to be used by git operations in core.ts to capture and limit terminal output.
|
|
17
|
+
* When the buffer exceeds capacity, chunks are removed from the beginning (oldest first),
|
|
18
|
+
* and partial chunks may be trimmed to fit exactly within the capacity limit.
|
|
19
|
+
*/
|
|
20
|
+
export const pushTerminalChunk = (chunks, capacity, chunk) => {
|
|
21
|
+
chunks.push(coerceToString(chunk));
|
|
22
|
+
let terminalOutputLength = chunks.reduce((acc, cur) => acc + cur.length, 0);
|
|
23
|
+
while (terminalOutputLength > capacity) {
|
|
24
|
+
const firstChunk = chunks[0];
|
|
25
|
+
const overrun = terminalOutputLength - capacity;
|
|
26
|
+
if (overrun >= firstChunk.length) {
|
|
27
|
+
chunks.shift();
|
|
28
|
+
terminalOutputLength -= firstChunk.length;
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
chunks[0] = firstChunk.substring(overrun);
|
|
32
|
+
terminalOutputLength -= overrun;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
//# sourceMappingURL=push-terminal-chunk.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"push-terminal-chunk.js","sourceRoot":"","sources":["../../src/git/push-terminal-chunk.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AAEtD;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAC/B,MAAgB,EAChB,QAAgB,EAChB,KAAsB,EACtB,EAAE;IACF,MAAM,CAAC,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,CAAA;IAClC,IAAI,oBAAoB,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC,GAAG,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC,CAAA;IAE3E,OAAO,oBAAoB,GAAG,QAAQ,EAAE,CAAC;QACvC,MAAM,UAAU,GAAG,MAAM,CAAC,CAAC,CAAC,CAAA;QAC5B,MAAM,OAAO,GAAG,oBAAoB,GAAG,QAAQ,CAAA;QAE/C,IAAI,OAAO,IAAI,UAAU,CAAC,MAAM,EAAE,CAAC;YACjC,MAAM,CAAC,KAAK,EAAE,CAAA;YACd,oBAAoB,IAAI,UAAU,CAAC,MAAM,CAAA;QAC3C,CAAC;aAAM,CAAC;YACN,MAAM,CAAC,CAAC,CAAC,GAAG,UAAU,CAAC,SAAS,CAAC,OAAO,CAAC,CAAA;YACzC,oBAAoB,IAAI,OAAO,CAAA;QACjC,CAAC;IACH,CAAC;AACH,CAAC,CAAA"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { HookCallbackOptions } from './core.js';
|
|
2
|
+
import { Repository } from '../models/repository.js';
|
|
3
|
+
import { IPushProgress } from '../models/progress.js';
|
|
4
|
+
import { IRemote } from '../models/remote.js';
|
|
5
|
+
import { Branch } from '../models/branch.js';
|
|
6
|
+
export type PushOptions = {
|
|
7
|
+
/**
|
|
8
|
+
* Force-push the branch without losing changes in the remote that
|
|
9
|
+
* haven't been fetched.
|
|
10
|
+
*
|
|
11
|
+
* See https://git-scm.com/docs/git-push#Documentation/git-push.txt---no-force-with-lease
|
|
12
|
+
*/
|
|
13
|
+
readonly forceWithLease?: boolean;
|
|
14
|
+
/** A branch to push instead of the current branch */
|
|
15
|
+
readonly branch?: Branch;
|
|
16
|
+
readonly noVerify?: boolean;
|
|
17
|
+
} & HookCallbackOptions;
|
|
18
|
+
/**
|
|
19
|
+
* Push from the remote to the branch, optionally setting the upstream.
|
|
20
|
+
*
|
|
21
|
+
* @param repository - The repository from which to push
|
|
22
|
+
*
|
|
23
|
+
* @param account - The account to use when authenticating with the remote
|
|
24
|
+
*
|
|
25
|
+
* @param remote - The remote to push the specified branch to
|
|
26
|
+
*
|
|
27
|
+
* @param localBranch - The local branch to push
|
|
28
|
+
*
|
|
29
|
+
* @param remoteBranch - The remote branch to push to
|
|
30
|
+
*
|
|
31
|
+
* @param tagsToPush - The tags to push along with the branch.
|
|
32
|
+
*
|
|
33
|
+
* @param options - Optional customizations for the push execution.
|
|
34
|
+
* see PushOptions for more information.
|
|
35
|
+
*
|
|
36
|
+
* @param progressCallback - An optional function which will be invoked
|
|
37
|
+
* with information about the current progress
|
|
38
|
+
* of the push operation. When provided this enables
|
|
39
|
+
* the '--progress' command line flag for
|
|
40
|
+
* 'git push'.
|
|
41
|
+
*/
|
|
42
|
+
export declare function push(repository: Repository, remote: IRemote, localBranch: string, remoteBranch: string | null, tagsToPush: ReadonlyArray<string> | null, options?: PushOptions, progressCallback?: (progress: IPushProgress) => void): Promise<void>;
|
package/dist/git/push.js
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { git } from './core.js';
|
|
2
|
+
import { PushProgressParser, executionOptionsWithProgress } from '../lib/progress/index.js';
|
|
3
|
+
import { envForRemoteOperation } from './environment.js';
|
|
4
|
+
/**
|
|
5
|
+
* Push from the remote to the branch, optionally setting the upstream.
|
|
6
|
+
*
|
|
7
|
+
* @param repository - The repository from which to push
|
|
8
|
+
*
|
|
9
|
+
* @param account - The account to use when authenticating with the remote
|
|
10
|
+
*
|
|
11
|
+
* @param remote - The remote to push the specified branch to
|
|
12
|
+
*
|
|
13
|
+
* @param localBranch - The local branch to push
|
|
14
|
+
*
|
|
15
|
+
* @param remoteBranch - The remote branch to push to
|
|
16
|
+
*
|
|
17
|
+
* @param tagsToPush - The tags to push along with the branch.
|
|
18
|
+
*
|
|
19
|
+
* @param options - Optional customizations for the push execution.
|
|
20
|
+
* see PushOptions for more information.
|
|
21
|
+
*
|
|
22
|
+
* @param progressCallback - An optional function which will be invoked
|
|
23
|
+
* with information about the current progress
|
|
24
|
+
* of the push operation. When provided this enables
|
|
25
|
+
* the '--progress' command line flag for
|
|
26
|
+
* 'git push'.
|
|
27
|
+
*/
|
|
28
|
+
export async function push(repository, remote, localBranch, remoteBranch, tagsToPush, options, progressCallback) {
|
|
29
|
+
const args = [
|
|
30
|
+
'push',
|
|
31
|
+
remote.name,
|
|
32
|
+
remoteBranch ? `${localBranch}:${remoteBranch}` : localBranch,
|
|
33
|
+
];
|
|
34
|
+
if (tagsToPush !== null) {
|
|
35
|
+
args.push(...tagsToPush);
|
|
36
|
+
}
|
|
37
|
+
if (!remoteBranch) {
|
|
38
|
+
args.push('--set-upstream');
|
|
39
|
+
}
|
|
40
|
+
else if (options?.forceWithLease) {
|
|
41
|
+
args.push('--force-with-lease');
|
|
42
|
+
}
|
|
43
|
+
if (options?.noVerify) {
|
|
44
|
+
args.push('--no-verify');
|
|
45
|
+
}
|
|
46
|
+
let opts = {
|
|
47
|
+
env: await envForRemoteOperation(remote.url),
|
|
48
|
+
interceptHooks: ['pre-push'],
|
|
49
|
+
onHookProgress: options?.onHookProgress,
|
|
50
|
+
onHookFailure: options?.onHookFailure,
|
|
51
|
+
onTerminalOutputAvailable: options?.onTerminalOutputAvailable,
|
|
52
|
+
};
|
|
53
|
+
if (progressCallback) {
|
|
54
|
+
args.push('--progress');
|
|
55
|
+
const title = `Pushing to ${remote.name}`;
|
|
56
|
+
const kind = 'push';
|
|
57
|
+
opts = await executionOptionsWithProgress({ ...opts, trackLFSProgress: true }, new PushProgressParser(), progress => {
|
|
58
|
+
const description = progress.kind === 'progress' ? progress.details.text : progress.text;
|
|
59
|
+
const value = progress.percent;
|
|
60
|
+
progressCallback({
|
|
61
|
+
kind,
|
|
62
|
+
title,
|
|
63
|
+
description,
|
|
64
|
+
value,
|
|
65
|
+
remote: remote.name,
|
|
66
|
+
branch: localBranch,
|
|
67
|
+
});
|
|
68
|
+
});
|
|
69
|
+
// Initial progress
|
|
70
|
+
progressCallback({
|
|
71
|
+
kind: 'push',
|
|
72
|
+
title,
|
|
73
|
+
value: 0,
|
|
74
|
+
remote: remote.name,
|
|
75
|
+
branch: localBranch,
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
await git(args, repository.path, 'push', opts);
|
|
79
|
+
}
|
|
80
|
+
//# sourceMappingURL=push.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"push.js","sourceRoot":"","sources":["../../src/git/push.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAmD,MAAM,WAAW,CAAA;AAGhF,OAAO,EAAE,kBAAkB,EAAE,4BAA4B,EAAE,MAAM,0BAA0B,CAAA;AAE3F,OAAO,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAA;AAkBxD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,CAAC,KAAK,UAAU,IAAI,CACxB,UAAsB,EACtB,MAAe,EACf,WAAmB,EACnB,YAA2B,EAC3B,UAAwC,EACxC,OAAqB,EACrB,gBAAoD;IAEpD,MAAM,IAAI,GAAG;QACX,MAAM;QACN,MAAM,CAAC,IAAI;QACX,YAAY,CAAC,CAAC,CAAC,GAAG,WAAW,IAAI,YAAY,EAAE,CAAC,CAAC,CAAC,WAAW;KAC9D,CAAA;IAED,IAAI,UAAU,KAAK,IAAI,EAAE,CAAC;QACxB,IAAI,CAAC,IAAI,CAAC,GAAG,UAAU,CAAC,CAAA;IAC1B,CAAC;IACD,IAAI,CAAC,YAAY,EAAE,CAAC;QAClB,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAA;IAC7B,CAAC;SAAM,IAAI,OAAO,EAAE,cAAc,EAAE,CAAC;QACnC,IAAI,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAA;IACjC,CAAC;IAED,IAAI,OAAO,EAAE,QAAQ,EAAE,CAAC;QACtB,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,CAAA;IAC1B,CAAC;I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0 +1,119 @@
|
|
|
1
|
+
import { Repository } from '../models/repository.js';
|
|
2
|
+
import { RebaseInternalState } from '../models/rebase.js';
|
|
3
|
+
import { IMultiCommitOperationProgress } from '../models/progress.js';
|
|
4
|
+
import { WorkingDirectoryFileChange } from '../models/status.js';
|
|
5
|
+
import { ManualConflictResolution } from '../models/manual-conflict-resolution.js';
|
|
6
|
+
import { Commit, CommitOneLine } from '../models/commit.js';
|
|
7
|
+
import { HookCallbackOptions } from './core.js';
|
|
8
|
+
import { Branch } from '../models/branch.js';
|
|
9
|
+
/** The app-specific results from attempting to rebase a repository */
|
|
10
|
+
export declare enum RebaseResult {
|
|
11
|
+
/**
|
|
12
|
+
* Git completed the rebase without reporting any errors, and the caller can
|
|
13
|
+
* signal success to the user.
|
|
14
|
+
*/
|
|
15
|
+
CompletedWithoutError = "CompletedWithoutError",
|
|
16
|
+
/**
|
|
17
|
+
* Git completed the rebase without reporting any errors, but the branch was
|
|
18
|
+
* already up to date and there was nothing to do.
|
|
19
|
+
*/
|
|
20
|
+
AlreadyUpToDate = "AlreadyUpToDate",
|
|
21
|
+
/**
|
|
22
|
+
* The rebase encountered conflicts while attempting to rebase, and these
|
|
23
|
+
* need to be resolved by the user before the rebase can continue.
|
|
24
|
+
*/
|
|
25
|
+
ConflictsEncountered = "ConflictsEncountered",
|
|
26
|
+
/**
|
|
27
|
+
* The rebase was not able to continue as tracked files were not staged in
|
|
28
|
+
* the index.
|
|
29
|
+
*/
|
|
30
|
+
OutstandingFilesNotStaged = "OutstandingFilesNotStaged",
|
|
31
|
+
/**
|
|
32
|
+
* The rebase was not attempted because it could not check the status of the
|
|
33
|
+
* repository. The caller needs to confirm the repository is in a usable
|
|
34
|
+
* state.
|
|
35
|
+
*/
|
|
36
|
+
Aborted = "Aborted",
|
|
37
|
+
/**
|
|
38
|
+
* An unexpected error as part of the rebase flow was caught and handled.
|
|
39
|
+
*
|
|
40
|
+
* Check the logs to find the relevant Git details.
|
|
41
|
+
*/
|
|
42
|
+
Error = "Error"
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Get the internal state about the rebase being performed on a repository. This
|
|
46
|
+
* information is required to help Desktop display information to the user
|
|
47
|
+
* about the current action as well as the options available.
|
|
48
|
+
*
|
|
49
|
+
* Returns `null` if no rebase is detected, or if the expected information
|
|
50
|
+
* cannot be found in the repository.
|
|
51
|
+
*/
|
|
52
|
+
export declare function getRebaseInternalState(repository: Repository): Promise<RebaseInternalState | null>;
|
|
53
|
+
/**
|
|
54
|
+
* Inspect the `.git/rebase-merge` folder and convert the current rebase state
|
|
55
|
+
* into data that can be provided to the rebase flow to update the application
|
|
56
|
+
* state.
|
|
57
|
+
*
|
|
58
|
+
* This is required when Desktop is not responsible for initiating the rebase:
|
|
59
|
+
*
|
|
60
|
+
* - when a rebase outside Desktop encounters conflicts
|
|
61
|
+
* - when a `git pull --rebase` was run and encounters conflicts
|
|
62
|
+
*
|
|
63
|
+
*/
|
|
64
|
+
export declare function getRebaseSnapshot(repository: Repository): Promise<{
|
|
65
|
+
progress: IMultiCommitOperationProgress;
|
|
66
|
+
commits: ReadonlyArray<CommitOneLine>;
|
|
67
|
+
} | null>;
|
|
68
|
+
/**
|
|
69
|
+
* A stub function to use for initiating rebase in the app.
|
|
70
|
+
*
|
|
71
|
+
* If the rebase fails, the repository will be in an indeterminate state where
|
|
72
|
+
* the rebase is stuck.
|
|
73
|
+
*
|
|
74
|
+
* If the rebase completes without error, `featureBranch` will be checked out
|
|
75
|
+
* and it will probably have a different commit history.
|
|
76
|
+
*
|
|
77
|
+
* @param baseBranch the ref to start the rebase from
|
|
78
|
+
* @param targetBranch the ref to rebase onto `baseBranch`
|
|
79
|
+
*/
|
|
80
|
+
export declare function rebase(repository: Repository, baseBranch: Branch, targetBranch: Branch, progressCallback?: (progress: IMultiCommitOperationProgress) => void): Promise<RebaseResult>;
|
|
81
|
+
/** Abandon the current rebase operation */
|
|
82
|
+
export declare function abortRebase(repository: Repository): Promise<void>;
|
|
83
|
+
/**
|
|
84
|
+
* Proceed with the current rebase operation and report back on whether it completed
|
|
85
|
+
*
|
|
86
|
+
* It is expected that the index has staged files which are cleanly rebased onto
|
|
87
|
+
* the base branch, and the remaining unstaged files are those which need manual
|
|
88
|
+
* resolution or were changed by the user to address inline conflicts.
|
|
89
|
+
*
|
|
90
|
+
*/
|
|
91
|
+
export declare function continueRebase(repository: Repository, files: ReadonlyArray<WorkingDirectoryFileChange>, manualResolutions?: ReadonlyMap<string, ManualConflictResolution>, opts?: RebaseInteractiveOptions): Promise<RebaseResult>;
|
|
92
|
+
export type RebaseInteractiveOptions = {
|
|
93
|
+
/**
|
|
94
|
+
* a description of the action to be displayed in the progress dialog - i.e. Squash, Amend, etc..
|
|
95
|
+
*/
|
|
96
|
+
action?: string;
|
|
97
|
+
/**
|
|
98
|
+
* the GIT_EDITOR environment variable to use during the interactive rebase,
|
|
99
|
+
* defaults to ':' which is a no-op command
|
|
100
|
+
*/
|
|
101
|
+
gitEditor?: string;
|
|
102
|
+
progressCallback?: (progress: IMultiCommitOperationProgress) => void;
|
|
103
|
+
commits?: ReadonlyArray<Commit>;
|
|
104
|
+
noVerify?: boolean;
|
|
105
|
+
} & HookCallbackOptions;
|
|
106
|
+
/**
|
|
107
|
+
* Method for initiating interactive rebase in the app.
|
|
108
|
+
*
|
|
109
|
+
* In order to modify the interactive todo list during interactive rebase, we
|
|
110
|
+
* create a temporary todo list of our own. Pass that file's path into our
|
|
111
|
+
* interactive rebase and using the sequence.editor to cat replace the
|
|
112
|
+
* interactive todo list with the contents of our generated one.
|
|
113
|
+
*
|
|
114
|
+
* @param pathOfGeneratedTodo path to generated todo list for interactive rebase
|
|
115
|
+
* @param lastRetainedCommitRef the commit before the earliest commit to be
|
|
116
|
+
* changed during the interactive rebase or null if commit is root (first commit
|
|
117
|
+
* in history) of branch
|
|
118
|
+
*/
|
|
119
|
+
export declare function rebaseInteractive(repository: Repository, pathOfGeneratedTodo: string, lastRetainedCommitRef: string | null, opts?: RebaseInteractiveOptions): Promise<RebaseResult>;
|