git-chopstick-core 0.1.1 → 0.1.2
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/dist/git/checkout-index.js +29 -0
- 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/dist/git/interpret-trailers.d.ts +88 -0
- 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/dist/git/push-terminal-chunk.d.ts +19 -0
- 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/dist/git/show.js +59 -0
- 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/dist/git/update-ref.js +32 -0
- package/dist/git/update-ref.js.map +1 -0
- package/dist/git/var.d.ts +18 -0
- package/dist/git/var.js +33 -0
- 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 +137 -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 +13 -4
- package/src/git/add.ts +3 -3
- package/src/git/apply.ts +8 -8
- package/src/git/authentication.ts +3 -2
- package/src/git/branch.ts +10 -10
- package/src/git/checkout-index.ts +2 -2
- package/src/git/checkout.ts +12 -12
- package/src/git/cherry-pick.ts +16 -16
- package/src/git/clean.ts +2 -2
- package/src/git/clone.ts +6 -6
- package/src/git/commit.ts +7 -7
- package/src/git/config.ts +2 -2
- package/src/git/core.ts +8 -8
- package/src/git/credential.ts +1 -1
- package/src/git/diff-check.ts +1 -1
- package/src/git/diff-index.ts +2 -2
- package/src/git/diff.ts +18 -18
- package/src/git/environment.ts +5 -5
- package/src/git/fetch.ts +7 -7
- package/src/git/for-each-ref.ts +5 -5
- package/src/git/format-patch.ts +3 -3
- package/src/git/git-delimiter-parser.ts +1 -1
- package/src/git/gitignore.ts +2 -2
- package/src/git/index.ts +46 -36
- package/src/git/init.ts +2 -2
- package/src/git/interpret-trailers.ts +3 -3
- package/src/git/lfs.ts +2 -2
- package/src/git/log.ts +8 -8
- package/src/git/merge-tree.ts +5 -5
- package/src/git/merge.ts +5 -5
- package/src/git/multi-operation-terminal-output.ts +3 -3
- package/src/git/pull.ts +7 -7
- package/src/git/push-terminal-chunk.ts +1 -1
- package/src/git/push.ts +7 -7
- package/src/git/rebase.ts +16 -16
- package/src/git/reflog.ts +2 -2
- package/src/git/refs.ts +2 -2
- package/src/git/remote.ts +6 -6
- package/src/git/reorder.ts +7 -7
- package/src/git/reset.ts +3 -3
- package/src/git/rev-list.ts +5 -5
- package/src/git/rev-parse.ts +2 -2
- package/src/git/revert.ts +8 -8
- package/src/git/rm.ts +3 -3
- package/src/git/show.ts +4 -4
- package/src/git/spawn.ts +3 -3
- package/src/git/squash.ts +7 -7
- package/src/git/stage.ts +7 -7
- package/src/git/stash.ts +10 -10
- package/src/git/status.ts +13 -13
- package/src/git/submodule.ts +9 -9
- package/src/git/tag.ts +4 -4
- package/src/git/update-index.ts +5 -5
- package/src/git/update-ref.ts +2 -2
- package/src/git/var.ts +3 -3
- package/src/git/worktree-include.ts +3 -3
- package/src/git/worktree.ts +4 -4
- package/src/index.ts +9 -21
- package/src/lib/diff-parser.ts +2 -2
- package/src/lib/get-old-path.ts +1 -1
- package/src/lib/git/environment.ts +1 -1
- package/src/lib/patch-formatter.ts +3 -3
- package/src/lib/progress/from-process.ts +1 -1
- package/src/lib/progress/index.ts +1 -1
- package/src/lib/status-parser.ts +2 -2
- package/src/models/branch.ts +1 -1
- package/src/models/cherry-pick.ts +2 -2
- package/src/models/commit.ts +1 -1
- package/src/models/diff/diff-data.ts +3 -3
- package/src/models/diff/index.ts +6 -6
- package/src/models/diff/raw-diff.ts +1 -1
- package/src/models/index.ts +36 -0
- package/src/models/rebase.ts +2 -2
- package/src/models/stash-entry.ts +1 -1
- package/src/models/status.ts +1 -1
- package/examples/get-status.ts +0 -84
- package/tsconfig.json +0 -17
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import { DiffSelectionType } from './diff/index.js';
|
|
2
|
+
export var GitStatusEntry;
|
|
3
|
+
(function (GitStatusEntry) {
|
|
4
|
+
GitStatusEntry["Modified"] = "M";
|
|
5
|
+
GitStatusEntry["Added"] = "A";
|
|
6
|
+
GitStatusEntry["Deleted"] = "D";
|
|
7
|
+
GitStatusEntry["Renamed"] = "R";
|
|
8
|
+
GitStatusEntry["Copied"] = "C";
|
|
9
|
+
GitStatusEntry["Unchanged"] = ".";
|
|
10
|
+
GitStatusEntry["Untracked"] = "?";
|
|
11
|
+
GitStatusEntry["Ignored"] = "!";
|
|
12
|
+
GitStatusEntry["UpdatedButUnmerged"] = "U";
|
|
13
|
+
})(GitStatusEntry || (GitStatusEntry = {}));
|
|
14
|
+
export var AppFileStatusKind;
|
|
15
|
+
(function (AppFileStatusKind) {
|
|
16
|
+
AppFileStatusKind["New"] = "New";
|
|
17
|
+
AppFileStatusKind["Modified"] = "Modified";
|
|
18
|
+
AppFileStatusKind["Deleted"] = "Deleted";
|
|
19
|
+
AppFileStatusKind["Copied"] = "Copied";
|
|
20
|
+
AppFileStatusKind["Renamed"] = "Renamed";
|
|
21
|
+
AppFileStatusKind["Conflicted"] = "Conflicted";
|
|
22
|
+
AppFileStatusKind["Untracked"] = "Untracked";
|
|
23
|
+
})(AppFileStatusKind || (AppFileStatusKind = {}));
|
|
24
|
+
export function isConflictedFileStatus(appFileStatus) {
|
|
25
|
+
return appFileStatus.kind === AppFileStatusKind.Conflicted;
|
|
26
|
+
}
|
|
27
|
+
export function isConflictWithMarkers(conflictedFileStatus) {
|
|
28
|
+
return 'conflictMarkerCount' in conflictedFileStatus;
|
|
29
|
+
}
|
|
30
|
+
export var UnmergedEntrySummary;
|
|
31
|
+
(function (UnmergedEntrySummary) {
|
|
32
|
+
UnmergedEntrySummary["AddedByUs"] = "added-by-us";
|
|
33
|
+
UnmergedEntrySummary["DeletedByUs"] = "deleted-by-us";
|
|
34
|
+
UnmergedEntrySummary["AddedByThem"] = "added-by-them";
|
|
35
|
+
UnmergedEntrySummary["DeletedByThem"] = "deleted-by-them";
|
|
36
|
+
UnmergedEntrySummary["BothDeleted"] = "both-deleted";
|
|
37
|
+
UnmergedEntrySummary["BothAdded"] = "both-added";
|
|
38
|
+
UnmergedEntrySummary["BothModified"] = "both-modified";
|
|
39
|
+
})(UnmergedEntrySummary || (UnmergedEntrySummary = {}));
|
|
40
|
+
export class FileChange {
|
|
41
|
+
path;
|
|
42
|
+
status;
|
|
43
|
+
id;
|
|
44
|
+
constructor(path, status) {
|
|
45
|
+
this.path = path;
|
|
46
|
+
this.status = status;
|
|
47
|
+
if (status.kind === AppFileStatusKind.Renamed ||
|
|
48
|
+
status.kind === AppFileStatusKind.Copied) {
|
|
49
|
+
this.id = `${status.kind}+${path}+${status.oldPath}`;
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
this.id = `${status.kind}+${path}`;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
isDeleted() {
|
|
56
|
+
return this.status.kind === AppFileStatusKind.Deleted;
|
|
57
|
+
}
|
|
58
|
+
isNew() {
|
|
59
|
+
return this.status.kind === AppFileStatusKind.New;
|
|
60
|
+
}
|
|
61
|
+
isModified() {
|
|
62
|
+
return this.status.kind === AppFileStatusKind.Modified;
|
|
63
|
+
}
|
|
64
|
+
isUntracked() {
|
|
65
|
+
return this.status.kind === AppFileStatusKind.Untracked;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
export class WorkingDirectoryFileChange extends FileChange {
|
|
69
|
+
selection;
|
|
70
|
+
constructor(path, status, selection) {
|
|
71
|
+
super(path, status);
|
|
72
|
+
this.selection = selection;
|
|
73
|
+
}
|
|
74
|
+
withIncludeAll(include) {
|
|
75
|
+
const newSelection = include
|
|
76
|
+
? this.selection.withSelectAll()
|
|
77
|
+
: this.selection.withSelectNone();
|
|
78
|
+
return this.withSelection(newSelection);
|
|
79
|
+
}
|
|
80
|
+
withSelection(selection) {
|
|
81
|
+
return new WorkingDirectoryFileChange(this.path, this.status, selection);
|
|
82
|
+
}
|
|
83
|
+
isIncludedInCommit() {
|
|
84
|
+
return this.selection.getSelectionType() === DiffSelectionType.All;
|
|
85
|
+
}
|
|
86
|
+
isExcludedFromCommit() {
|
|
87
|
+
return this.selection.getSelectionType() === DiffSelectionType.None;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
export class CommittedFileChange extends FileChange {
|
|
91
|
+
commitish;
|
|
92
|
+
parentCommitish;
|
|
93
|
+
constructor(path, status, commitish, parentCommitish) {
|
|
94
|
+
super(path, status);
|
|
95
|
+
this.commitish = commitish;
|
|
96
|
+
this.parentCommitish = parentCommitish;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
export class WorkingDirectoryStatus {
|
|
100
|
+
files;
|
|
101
|
+
includeAll;
|
|
102
|
+
static fromFiles(files) {
|
|
103
|
+
return new WorkingDirectoryStatus(files, getIncludeAllState(files));
|
|
104
|
+
}
|
|
105
|
+
fileIxById = new Map();
|
|
106
|
+
constructor(files, includeAll = true) {
|
|
107
|
+
this.files = files;
|
|
108
|
+
this.includeAll = includeAll;
|
|
109
|
+
files.forEach((f, ix) => this.fileIxById.set(f.id, ix));
|
|
110
|
+
}
|
|
111
|
+
withIncludeAllFiles(includeAll) {
|
|
112
|
+
const newFiles = this.files.map(f => f.withIncludeAll(includeAll));
|
|
113
|
+
return new WorkingDirectoryStatus(newFiles, includeAll);
|
|
114
|
+
}
|
|
115
|
+
findFileWithID(id) {
|
|
116
|
+
const ix = this.fileIxById.get(id);
|
|
117
|
+
return ix !== undefined ? this.files[ix] || null : null;
|
|
118
|
+
}
|
|
119
|
+
findFileIndexByID(id) {
|
|
120
|
+
const ix = this.fileIxById.get(id);
|
|
121
|
+
return ix !== undefined ? ix : -1;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
function getIncludeAllState(files) {
|
|
125
|
+
if (!files.length)
|
|
126
|
+
return true;
|
|
127
|
+
const allSelected = files.every(f => f.selection.getSelectionType() === DiffSelectionType.All);
|
|
128
|
+
const noneSelected = files.every(f => f.selection.getSelectionType() === DiffSelectionType.None);
|
|
129
|
+
if (allSelected)
|
|
130
|
+
return true;
|
|
131
|
+
if (noneSelected)
|
|
132
|
+
return false;
|
|
133
|
+
return null;
|
|
134
|
+
}
|
|
135
|
+
//# sourceMappingURL=status.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"status.js","sourceRoot":"","sources":["../../src/models/status.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,iBAAiB,EAAE,MAAM,iBAAiB,CAAA;AAElE,MAAM,CAAN,IAAY,cAUX;AAVD,WAAY,cAAc;IACxB,gCAAc,CAAA;IACd,6BAAW,CAAA;IACX,+BAAa,CAAA;IACb,+BAAa,CAAA;IACb,8BAAY,CAAA;IACZ,iCAAe,CAAA;IACf,iCAAe,CAAA;IACf,+BAAa,CAAA;IACb,0CAAwB,CAAA;AAC1B,CAAC,EAVW,cAAc,KAAd,cAAc,QAUzB;AAED,MAAM,CAAN,IAAY,iBAQX;AARD,WAAY,iBAAiB;IAC3B,gCAAW,CAAA;IACX,0CAAqB,CAAA;IACrB,wCAAmB,CAAA;IACnB,sCAAiB,CAAA;IACjB,wCAAmB,CAAA;IACnB,8CAAyB,CAAA;IACzB,4CAAuB,CAAA;AACzB,CAAC,EARW,iBAAiB,KAAjB,iBAAiB,QAQ5B;AA6BD,MAAM,UAAU,sBAAsB,CACpC,aAA4B;IAE5B,OAAO,aAAa,CAAC,IAAI,KAAK,iBAAiB,CAAC,UAAU,CAAA;AAC5D,CAAC;AAED,MAAM,UAAU,qBAAqB,CACnC,oBAA0C;IAE1C,OAAO,qBAAqB,IAAI,oBAAoB,CAAA;AACtD,CAAC;AAmCD,MAAM,CAAN,IAAY,oBAQX;AARD,WAAY,oBAAoB;IAC9B,iDAAyB,CAAA;IACzB,qDAA6B,CAAA;IAC7B,qDAA6B,CAAA;IAC7B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9B,OAAO,IAAI,CAAA;AACb,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export type SubmoduleEntry = {
|
|
2
|
+
readonly path: string;
|
|
3
|
+
readonly url: string;
|
|
4
|
+
readonly describe?: string;
|
|
5
|
+
readonly sha: string;
|
|
6
|
+
readonly status: SubmoduleStatus;
|
|
7
|
+
};
|
|
8
|
+
export type SubmoduleStatus = {
|
|
9
|
+
readonly commitChanged: boolean;
|
|
10
|
+
readonly modifiedChanges: boolean;
|
|
11
|
+
readonly untrackedChanges: boolean;
|
|
12
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"submodule.js","sourceRoot":"","sources":["../../src/models/submodule.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export type WorktreeType = 'main' | 'linked';
|
|
2
|
+
export type WorktreeEntry = {
|
|
3
|
+
readonly path: string;
|
|
4
|
+
readonly head: string;
|
|
5
|
+
readonly branch: string | null;
|
|
6
|
+
readonly isDetached: boolean;
|
|
7
|
+
readonly type: WorktreeType;
|
|
8
|
+
readonly isLocked: boolean;
|
|
9
|
+
readonly isPrunable: boolean;
|
|
10
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"worktree.js","sourceRoot":"","sources":["../../src/models/worktree.ts"],"names":[],"mappings":""}
|
package/package.json
CHANGED
|
@@ -1,17 +1,26 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "git-chopstick-core",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
|
|
5
5
|
"type": "module",
|
|
6
|
-
"main": "./
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
7
8
|
"exports": {
|
|
8
9
|
".": {
|
|
9
|
-
"import": "./src/index.ts"
|
|
10
|
+
"import": "./src/index.ts",
|
|
11
|
+
"types": "./src/index.ts"
|
|
12
|
+
},
|
|
13
|
+
"./*": {
|
|
14
|
+
"import": "./src/*",
|
|
15
|
+
"types": "./src/*"
|
|
10
16
|
}
|
|
11
17
|
},
|
|
18
|
+
"files": ["dist", "src"],
|
|
12
19
|
"description": "Git backend library extracted from GitHub Desktop",
|
|
13
20
|
"scripts": {
|
|
14
|
-
"
|
|
21
|
+
"build": "tsc",
|
|
22
|
+
"typecheck": "tsc --noEmit",
|
|
23
|
+
"prepublishOnly": "npm run build"
|
|
15
24
|
},
|
|
16
25
|
"dependencies": {
|
|
17
26
|
"byline": "^5.0.0",
|
package/src/git/add.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { git } from './core'
|
|
2
|
-
import { Repository } from '../models/repository'
|
|
3
|
-
import { WorkingDirectoryFileChange } from '../models/status'
|
|
1
|
+
import { git } from './core.js'
|
|
2
|
+
import { Repository } from '../models/repository.js'
|
|
3
|
+
import { WorkingDirectoryFileChange } from '../models/status.js'
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Add a conflicted file to the index.
|
package/src/git/apply.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { GitError as DugiteError } from './exec'
|
|
2
|
-
import { git } from './core'
|
|
1
|
+
import { GitError as DugiteError } from './exec.js'
|
|
2
|
+
import { git } from './core.js'
|
|
3
3
|
import {
|
|
4
4
|
WorkingDirectoryFileChange,
|
|
5
5
|
AppFileStatusKind,
|
|
6
|
-
} from '../models/status'
|
|
7
|
-
import { DiffType, ITextDiff, DiffSelection } from '../models/diff'
|
|
8
|
-
import { Repository } from '../models/repository'
|
|
9
|
-
import { getWorkingDirectoryDiff } from './diff'
|
|
10
|
-
import { formatPatch, formatPatchToDiscardChanges } from '../lib/patch-formatter'
|
|
11
|
-
import { assertNever } from '../lib/fatal-error'
|
|
6
|
+
} from '../models/status.js'
|
|
7
|
+
import { DiffType, ITextDiff, DiffSelection } from '../models/diff/index.js'
|
|
8
|
+
import { Repository } from '../models/repository.js'
|
|
9
|
+
import { getWorkingDirectoryDiff } from './diff.js'
|
|
10
|
+
import { formatPatch, formatPatchToDiscardChanges } from '../lib/patch-formatter.js'
|
|
11
|
+
import { assertNever } from '../lib/fatal-error.js'
|
|
12
12
|
|
|
13
13
|
export async function applyPatchToIndex(
|
|
14
14
|
repository: Repository,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { GitError as DugiteError } from './exec'
|
|
1
|
+
import { GitError as DugiteError } from './exec.js'
|
|
2
2
|
|
|
3
3
|
/** Get the environment for authenticating remote operations. */
|
|
4
4
|
export function envForAuthentication(): Record<string, string | undefined> {
|
|
@@ -6,7 +6,8 @@ export function envForAuthentication(): Record<string, string | undefined> {
|
|
|
6
6
|
// supported since Git 2.3, this is used to ensure we never interactively prompt
|
|
7
7
|
// for credentials - even as a fallback
|
|
8
8
|
GIT_TERMINAL_PROMPT: '0',
|
|
9
|
-
|
|
9
|
+
// localStorage is not available in Node.js; fall back to process.env
|
|
10
|
+
GIT_TRACE: process.env.GIT_TRACE ?? '0',
|
|
10
11
|
}
|
|
11
12
|
}
|
|
12
13
|
|
package/src/git/branch.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { git, isGitError } from './core'
|
|
2
|
-
import { Repository } from '../models/repository'
|
|
3
|
-
import { Branch } from '../models/branch'
|
|
4
|
-
import { formatAsLocalRef } from './refs'
|
|
5
|
-
import { deleteRef } from './update-ref'
|
|
6
|
-
import { GitError as DugiteError } from './exec'
|
|
7
|
-
import { envForRemoteOperation } from './environment'
|
|
8
|
-
import { createForEachRefParser } from './git-delimiter-parser'
|
|
9
|
-
import { IRemote } from '../models/remote'
|
|
10
|
-
import { coerceToString } from './coerce-to-string'
|
|
1
|
+
import { git, isGitError } from './core.js'
|
|
2
|
+
import { Repository } from '../models/repository.js'
|
|
3
|
+
import { Branch } from '../models/branch.js'
|
|
4
|
+
import { formatAsLocalRef } from './refs.js'
|
|
5
|
+
import { deleteRef } from './update-ref.js'
|
|
6
|
+
import { GitError as DugiteError } from './exec.js'
|
|
7
|
+
import { envForRemoteOperation } from './environment.js'
|
|
8
|
+
import { createForEachRefParser } from './git-delimiter-parser.js'
|
|
9
|
+
import { IRemote } from '../models/remote.js'
|
|
10
|
+
import { coerceToString } from './coerce-to-string.js'
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* Create a new branch from the given start point.
|
package/src/git/checkout.ts
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { git, IGitStringExecutionOptions } from './core'
|
|
2
|
-
import { Repository } from '../models/repository'
|
|
3
|
-
import { Branch, BranchType } from '../models/branch'
|
|
4
|
-
import { clampProgress, ICheckoutProgress } from '../models/progress'
|
|
1
|
+
import { git, IGitStringExecutionOptions } from './core.js'
|
|
2
|
+
import { Repository } from '../models/repository.js'
|
|
3
|
+
import { Branch, BranchType } from '../models/branch.js'
|
|
4
|
+
import { clampProgress, ICheckoutProgress } from '../models/progress.js'
|
|
5
5
|
import {
|
|
6
6
|
CheckoutProgressParser,
|
|
7
7
|
executionOptionsWithProgress,
|
|
8
|
-
} from '../lib/progress'
|
|
9
|
-
import { AuthenticationErrors } from './authentication'
|
|
8
|
+
} from '../lib/progress/index.js'
|
|
9
|
+
import { AuthenticationErrors } from './authentication.js'
|
|
10
10
|
import {
|
|
11
11
|
envForRemoteOperation,
|
|
12
12
|
getFallbackUrlForProxyResolve,
|
|
13
|
-
} from './environment'
|
|
14
|
-
import { WorkingDirectoryFileChange } from '../models/status'
|
|
15
|
-
import { ManualConflictResolution } from '../models/manual-conflict-resolution'
|
|
16
|
-
import { CommitOneLine, shortenSHA } from '../models/commit'
|
|
17
|
-
import { IRemote } from '../models/remote'
|
|
18
|
-
import { updateSubmodulesAfterOperation } from './submodule'
|
|
13
|
+
} from './environment.js'
|
|
14
|
+
import { WorkingDirectoryFileChange } from '../models/status.js'
|
|
15
|
+
import { ManualConflictResolution } from '../models/manual-conflict-resolution.js'
|
|
16
|
+
import { CommitOneLine, shortenSHA } from '../models/commit.js'
|
|
17
|
+
import { IRemote } from '../models/remote.js'
|
|
18
|
+
import { updateSubmodulesAfterOperation } from './submodule.js'
|
|
19
19
|
|
|
20
20
|
export type ProgressCallback = (progress: ICheckoutProgress) => void
|
|
21
21
|
|
package/src/git/cherry-pick.ts
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import { GitError } from './exec'
|
|
2
|
-
import { Repository } from '../models/repository'
|
|
1
|
+
import { GitError } from './exec.js'
|
|
2
|
+
import { Repository } from '../models/repository.js'
|
|
3
3
|
import {
|
|
4
4
|
AppFileStatusKind,
|
|
5
5
|
WorkingDirectoryFileChange,
|
|
6
|
-
} from '../models/status'
|
|
6
|
+
} from '../models/status.js'
|
|
7
7
|
import {
|
|
8
8
|
git,
|
|
9
9
|
IGitExecutionOptions,
|
|
10
10
|
IGitResult,
|
|
11
11
|
IGitStringExecutionOptions,
|
|
12
|
-
} from './core'
|
|
13
|
-
import { getStatus } from './status'
|
|
14
|
-
import { stageFiles } from './update-index'
|
|
15
|
-
import { getCommitsInRange, revRange } from './rev-list'
|
|
16
|
-
import { CommitOneLine } from '../models/commit'
|
|
17
|
-
import { merge } from '../lib/merge'
|
|
12
|
+
} from './core.js'
|
|
13
|
+
import { getStatus } from './status.js'
|
|
14
|
+
import { stageFiles } from './update-index.js'
|
|
15
|
+
import { getCommitsInRange, revRange } from './rev-list.js'
|
|
16
|
+
import { CommitOneLine } from '../models/commit.js'
|
|
17
|
+
import { merge } from '../lib/merge.js'
|
|
18
18
|
import { ChildProcess } from 'child_process'
|
|
19
|
-
import { round } from '../lib/round'
|
|
19
|
+
import { round } from '../lib/round.js'
|
|
20
20
|
import byline from 'byline'
|
|
21
|
-
import { ICherryPickSnapshot } from '../models/cherry-pick'
|
|
22
|
-
import { ManualConflictResolution } from '../models/manual-conflict-resolution'
|
|
23
|
-
import { stageManualConflictResolution } from './stage'
|
|
24
|
-
import { getCommit } from '.'
|
|
25
|
-
import { IMultiCommitOperationProgress } from '../models/progress'
|
|
21
|
+
import { ICherryPickSnapshot } from '../models/cherry-pick.js'
|
|
22
|
+
import { ManualConflictResolution } from '../models/manual-conflict-resolution.js'
|
|
23
|
+
import { stageManualConflictResolution } from './stage.js'
|
|
24
|
+
import { getCommit } from './index.js'
|
|
25
|
+
import { IMultiCommitOperationProgress } from '../models/progress.js'
|
|
26
26
|
import { join } from 'path'
|
|
27
27
|
import { readFile } from 'fs/promises'
|
|
28
|
-
import { pathExists } from '../lib/path-exists'
|
|
28
|
+
import { pathExists } from '../lib/path-exists.js'
|
|
29
29
|
|
|
30
30
|
/** The app-specific results from attempting to cherry pick commits*/
|
|
31
31
|
export enum CherryPickResult {
|
package/src/git/clean.ts
CHANGED
package/src/git/clone.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { git, IGitStringExecutionOptions } from './core'
|
|
2
|
-
import { ICloneProgress } from '../models/progress'
|
|
3
|
-
import { CloneOptions } from '../models/clone-options'
|
|
4
|
-
import { CloneProgressParser, executionOptionsWithProgress } from '../lib/progress'
|
|
5
|
-
import { getDefaultBranch } from '../lib/helpers/default-branch'
|
|
6
|
-
import { envForRemoteOperation } from './environment'
|
|
1
|
+
import { git, IGitStringExecutionOptions } from './core.js'
|
|
2
|
+
import { ICloneProgress } from '../models/progress.js'
|
|
3
|
+
import { CloneOptions } from '../models/clone-options.js'
|
|
4
|
+
import { CloneProgressParser, executionOptionsWithProgress } from '../lib/progress/index.js'
|
|
5
|
+
import { getDefaultBranch } from '../lib/helpers/default-branch.js'
|
|
6
|
+
import { envForRemoteOperation } from './environment.js'
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* Clones a repository from a given url into to the specified path.
|
package/src/git/commit.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { git, HookCallbackOptions, parseCommitSHA } from './core'
|
|
2
|
-
import { stageFiles } from './update-index'
|
|
3
|
-
import { Repository } from '../models/repository'
|
|
4
|
-
import { WorkingDirectoryFileChange } from '../models/status'
|
|
5
|
-
import { unstageAll } from './reset'
|
|
6
|
-
import { ManualConflictResolution } from '../models/manual-conflict-resolution'
|
|
7
|
-
import { stageManualConflictResolution } from './stage'
|
|
1
|
+
import { git, HookCallbackOptions, parseCommitSHA } from './core.js'
|
|
2
|
+
import { stageFiles } from './update-index.js'
|
|
3
|
+
import { Repository } from '../models/repository.js'
|
|
4
|
+
import { WorkingDirectoryFileChange } from '../models/status.js'
|
|
5
|
+
import { unstageAll } from './reset.js'
|
|
6
|
+
import { ManualConflictResolution } from '../models/manual-conflict-resolution.js'
|
|
7
|
+
import { stageManualConflictResolution } from './stage.js'
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* @param repository repository to execute merge in
|
package/src/git/config.ts
CHANGED
package/src/git/core.ts
CHANGED
|
@@ -4,17 +4,17 @@ import {
|
|
|
4
4
|
parseError,
|
|
5
5
|
parseBadConfigValueErrorInfo,
|
|
6
6
|
ExecError,
|
|
7
|
-
} from './exec'
|
|
7
|
+
} from './exec.js'
|
|
8
8
|
|
|
9
|
-
import { assertNever } from '../lib/fatal-error'
|
|
10
|
-
import * as GitPerf from '../lib/git-perf'
|
|
9
|
+
import { assertNever } from '../lib/fatal-error.js'
|
|
10
|
+
import * as GitPerf from '../lib/git-perf.js'
|
|
11
11
|
import * as Path from 'path'
|
|
12
|
-
import { isErrnoException } from '../lib/errno-exception'
|
|
13
|
-
import { withTrampolineEnv } from '../lib/trampoline/trampoline-environment'
|
|
12
|
+
import { isErrnoException } from '../lib/errno-exception.js'
|
|
13
|
+
import { withTrampolineEnv } from '../lib/trampoline/trampoline-environment.js'
|
|
14
14
|
import { kStringMaxLength } from 'buffer'
|
|
15
|
-
import { withHooksEnv } from '../lib/hooks/with-hooks-env'
|
|
16
|
-
import { coerceToString } from './coerce-to-string'
|
|
17
|
-
import { pushTerminalChunk } from './push-terminal-chunk'
|
|
15
|
+
import { withHooksEnv } from '../lib/hooks/with-hooks-env.js'
|
|
16
|
+
import { coerceToString } from './coerce-to-string.js'
|
|
17
|
+
import { pushTerminalChunk } from './push-terminal-chunk.js'
|
|
18
18
|
|
|
19
19
|
export const isMaxBufferExceededError = (
|
|
20
20
|
error: unknown
|
package/src/git/credential.ts
CHANGED
package/src/git/diff-check.ts
CHANGED
package/src/git/diff-index.ts
CHANGED
package/src/git/diff.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import * as Path from 'path'
|
|
2
2
|
|
|
3
|
-
import { getBlobContents } from './show'
|
|
3
|
+
import { getBlobContents } from './show.js'
|
|
4
4
|
|
|
5
|
-
import { Repository } from '../models/repository'
|
|
5
|
+
import { Repository } from '../models/repository.js'
|
|
6
6
|
import {
|
|
7
7
|
WorkingDirectoryFileChange,
|
|
8
8
|
FileChange,
|
|
9
9
|
AppFileStatusKind,
|
|
10
10
|
SubmoduleStatus,
|
|
11
11
|
CommittedFileChange,
|
|
12
|
-
} from '../models/status'
|
|
12
|
+
} from '../models/status.js'
|
|
13
13
|
import {
|
|
14
14
|
DiffType,
|
|
15
15
|
IRawDiff,
|
|
@@ -19,23 +19,23 @@ import {
|
|
|
19
19
|
LineEndingsChange,
|
|
20
20
|
parseLineEndingText,
|
|
21
21
|
ILargeTextDiff,
|
|
22
|
-
} from '../models/diff'
|
|
22
|
+
} from '../models/diff/index.js'
|
|
23
23
|
|
|
24
|
-
import { DiffParser } from '../lib/diff-parser'
|
|
25
|
-
import { getOldPathOrDefault } from '../lib/get-old-path'
|
|
24
|
+
import { DiffParser } from '../lib/diff-parser.js'
|
|
25
|
+
import { getOldPathOrDefault } from '../lib/get-old-path.js'
|
|
26
26
|
import { readFile } from 'fs/promises'
|
|
27
|
-
import { forceUnwrap } from '../lib/fatal-error'
|
|
28
|
-
import { git } from './core'
|
|
29
|
-
import { NullTreeSHA } from './diff-index'
|
|
30
|
-
import { GitError } from './exec'
|
|
31
|
-
import { IChangesetData, parseRawLogWithNumstat } from './log'
|
|
32
|
-
import { getConfigValue } from './config'
|
|
33
|
-
import { getMergeBase } from './merge'
|
|
34
|
-
import { IStatusEntry } from '../lib/status-parser'
|
|
35
|
-
import { createLogParser } from './git-delimiter-parser'
|
|
36
|
-
import { enableImagePreviewsForDDSFiles } from '../lib/feature-flag'
|
|
37
|
-
import { unstageAll } from './reset'
|
|
38
|
-
import { stageFiles } from './update-index'
|
|
27
|
+
import { forceUnwrap } from '../lib/fatal-error.js'
|
|
28
|
+
import { git } from './core.js'
|
|
29
|
+
import { NullTreeSHA } from './diff-index.js'
|
|
30
|
+
import { GitError } from './exec.js'
|
|
31
|
+
import { IChangesetData, parseRawLogWithNumstat } from './log.js'
|
|
32
|
+
import { getConfigValue } from './config.js'
|
|
33
|
+
import { getMergeBase } from './merge.js'
|
|
34
|
+
import { IStatusEntry } from '../lib/status-parser.js'
|
|
35
|
+
import { createLogParser } from './git-delimiter-parser.js'
|
|
36
|
+
import { enableImagePreviewsForDDSFiles } from '../lib/feature-flag.js'
|
|
37
|
+
import { unstageAll } from './reset.js'
|
|
38
|
+
import { stageFiles } from './update-index.js'
|
|
39
39
|
import { isAbsolute } from 'path'
|
|
40
40
|
|
|
41
41
|
/**
|
package/src/git/environment.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { envForAuthentication } from './authentication'
|
|
2
|
-
import { resolveGitProxy as resolveGitProxyFn } from '../lib/resolve-git-proxy'
|
|
3
|
-
import { getHTMLURL } from '../lib/api'
|
|
4
|
-
import { Repository } from '../models/repository'
|
|
5
|
-
import { IRemote } from '../models/remote'
|
|
1
|
+
import { envForAuthentication } from './authentication.js'
|
|
2
|
+
import { resolveGitProxy as resolveGitProxyFn } from '../lib/resolve-git-proxy.js'
|
|
3
|
+
import { getHTMLURL } from '../lib/api.js'
|
|
4
|
+
import { Repository } from '../models/repository.js'
|
|
5
|
+
import { IRemote } from '../models/remote.js'
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* For many remote operations it's well known what the primary remote
|
package/src/git/fetch.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { git, IGitStringExecutionOptions } from './core'
|
|
2
|
-
import { Repository } from '../models/repository'
|
|
3
|
-
import { IFetchProgress } from '../models/progress'
|
|
4
|
-
import { FetchProgressParser, executionOptionsWithProgress } from '../lib/progress'
|
|
5
|
-
import { IRemote } from '../models/remote'
|
|
6
|
-
import { ITrackingBranch } from '../models/branch'
|
|
7
|
-
import { envForRemoteOperation } from './environment'
|
|
1
|
+
import { git, IGitStringExecutionOptions } from './core.js'
|
|
2
|
+
import { Repository } from '../models/repository.js'
|
|
3
|
+
import { IFetchProgress } from '../models/progress.js'
|
|
4
|
+
import { FetchProgressParser, executionOptionsWithProgress } from '../lib/progress/index.js'
|
|
5
|
+
import { IRemote } from '../models/remote.js'
|
|
6
|
+
import { ITrackingBranch } from '../models/branch.js'
|
|
7
|
+
import { envForRemoteOperation } from './environment.js'
|
|
8
8
|
|
|
9
9
|
async function getFetchArgs(
|
|
10
10
|
remote: string,
|
package/src/git/for-each-ref.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { git } from './core'
|
|
2
|
-
import { GitError } from './exec'
|
|
3
|
-
import { Repository } from '../models/repository'
|
|
1
|
+
import { git } from './core.js'
|
|
2
|
+
import { GitError } from './exec.js'
|
|
3
|
+
import { Repository } from '../models/repository.js'
|
|
4
4
|
import {
|
|
5
5
|
Branch,
|
|
6
6
|
BranchType,
|
|
7
7
|
IBranchTip,
|
|
8
8
|
ITrackingBranch,
|
|
9
|
-
} from '../models/branch'
|
|
10
|
-
import { createForEachRefParser } from './git-delimiter-parser'
|
|
9
|
+
} from '../models/branch.js'
|
|
10
|
+
import { createForEachRefParser } from './git-delimiter-parser.js'
|
|
11
11
|
|
|
12
12
|
/** Get all the branches. */
|
|
13
13
|
export async function getBranches(
|
package/src/git/format-patch.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { revRange } from './rev-list'
|
|
2
|
-
import { Repository } from '../models/repository'
|
|
3
|
-
import { git } from '.'
|
|
1
|
+
import { revRange } from './rev-list.js'
|
|
2
|
+
import { Repository } from '../models/repository.js'
|
|
3
|
+
import { git } from './index.js'
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Generate a patch representing the changes associated with a range of commits
|
package/src/git/gitignore.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as Path from 'path'
|
|
2
2
|
import * as FS from 'fs'
|
|
3
|
-
import { Repository } from '../models/repository'
|
|
4
|
-
import { getConfigValue } from './config'
|
|
3
|
+
import { Repository } from '../models/repository.js'
|
|
4
|
+
import { getConfigValue } from './config.js'
|
|
5
5
|
import { writeFile } from 'fs/promises'
|
|
6
6
|
|
|
7
7
|
/**
|