@pi-chamber/web 1.0.3 → 1.0.4-rc.1
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/assets/DiagramView-DfZMQkXY.js +1 -0
- package/dist/assets/{DiffView-D19Jps0i.js → DiffView-BjWUdbL5.js} +6 -6
- package/dist/assets/FileSaveConflictDialog-u5L4k_5k.js +3 -0
- package/dist/assets/FilesView-qP1ypN9J.js +6 -0
- package/dist/assets/GitHubDetailScaffold-zCKCy5OJ.js +11 -0
- package/dist/assets/GitHubLinkPicker-CwxKY3lN.js +1 -0
- package/dist/assets/GitHubListPrimitives-Ck3zllel.js +1 -0
- package/dist/assets/GitView-y2k2i4gR.js +9 -0
- package/dist/assets/IssuesSurface-HWgR87N3.js +7 -0
- package/dist/assets/JsonTreeView-DSuC4naV.js +1 -0
- package/dist/assets/{MarkdownRendererImpl-DV5Xkj8N.js → MarkdownRendererImpl-CT5ln9em.js} +5 -5
- package/dist/assets/PatchDiff-DArTeWeK.js +1 -0
- package/dist/assets/PierreDiffViewer-DQKujzLb.js +134 -0
- package/dist/assets/PullRequestsSurface-Cfb1wSvC.js +2 -0
- package/dist/assets/SessionSwitcherContent-DEGJyZBl.js +1 -0
- package/dist/assets/SessionSwitcherDropdown-cC9wVBH7.js +2 -0
- package/dist/assets/SessionUnreadDot-CELKNVIM.js +1 -0
- package/dist/assets/SettingsView-CZvRRgJe.js +6 -0
- package/dist/assets/SettingsWindow-CZM1dmVb.js +1 -0
- package/dist/assets/ToolOutputDialog-DClOSbJc.js +8 -0
- package/dist/assets/ToolPartDiffPreview-BaFiGUDE.js +1 -0
- package/dist/assets/{VirtualizedFileDiff-CJondRlh.js → VirtualizedFileDiff-D6KbvKc6.js} +3 -3
- package/dist/assets/Virtualizer-wpC51ZBQ.js +1 -0
- package/dist/assets/collapsible-DhV9d4dT.js +1 -0
- package/dist/assets/computeVirtualFileMetrics-CeMpF2xC.js +3 -0
- package/dist/assets/{contextFileOpenGuard-CsZL8yie.js → contextFileOpenGuard-Ck5u_kAP.js} +1 -1
- package/dist/assets/gitStatusPredicates-DEBSqUNE.js +1 -0
- package/dist/assets/githubLink-DT7i2NlH.js +10 -0
- package/dist/assets/index-6IO1AcJI.js +10 -0
- package/dist/assets/index-BAmzAlNx.css +1 -0
- package/dist/assets/index-eDf4LKLY.js +1 -0
- package/dist/assets/main-BczEScAA.js +2 -0
- package/dist/assets/main-CHLNMYeJ.js +136 -0
- package/dist/assets/markdownCore-C4Gk5Zht.js +2 -0
- package/dist/assets/miniChat-Do3hE87Z.js +2 -0
- package/dist/assets/mobile-CTnihwfa.js +2 -0
- package/dist/assets/permissionStore-B9Hkrqny.js +1 -0
- package/dist/assets/pi-session-focus-preference-LDVCJ_YR.js +10 -0
- package/dist/assets/renderDiffWithHighlighter-CDsgOnkH.js +1 -0
- package/dist/assets/renderElectronMiniChatApp-DSa3gYqR.js +2 -0
- package/dist/assets/renderFileWithHighlighter-TpKRyfCY.js +1 -0
- package/dist/assets/renderMobileApp-CPE-3uMl.js +11 -0
- package/dist/assets/runtimeEndpointReset-CzJfovWI.js +62 -0
- package/dist/assets/{runtimeSurface-BdndJV2m.js → runtimeSurface-DW_Ia4q3.js} +1 -1
- package/dist/assets/shell-CjFT_Tl9.js +1 -0
- package/dist/assets/sprite-HGQGInUp.js +6510 -0
- package/dist/assets/useAppFontEffects-CG3_yteE.js +212 -0
- package/dist/assets/{useFilesViewSearch-DJ3psTKU.js → useFilesViewSearch-C_LzYIgD.js} +1 -1
- package/dist/assets/useGitHubRemoteSearch-DsxWOzKZ.js +1 -0
- package/dist/assets/useSwitcherItems-BmoCnS9W.js +1 -0
- package/dist/assets/vendor-base-ui-DIkTOIJS.js +1 -0
- package/dist/assets/{vendor-beautiful-mermaid-D3YCkKz7.js → vendor-beautiful-mermaid-DApbjBp2.js} +1 -1
- package/dist/assets/vendor-boot-DyL2td56.js +69 -0
- package/dist/assets/vendor-codemirror-autocomplete-DsFn4GLp.js +1 -0
- package/dist/assets/vendor-codemirror-lang-angular-B_NMmBbS.js +1 -0
- package/dist/assets/vendor-codemirror-lang-cpp-GOE7Gjd0.js +1 -0
- package/dist/assets/vendor-codemirror-lang-css-Dwf2XpnZ.js +1 -0
- package/dist/assets/vendor-codemirror-lang-go-C2KHbcll.js +7 -0
- package/dist/assets/vendor-codemirror-lang-html-DcKqyeGk.js +1 -0
- package/dist/assets/vendor-codemirror-lang-java-6eGbyB2k.js +1 -0
- package/dist/assets/vendor-codemirror-lang-javascript-DpTUrvx8.js +13 -0
- package/dist/assets/vendor-codemirror-lang-jinja-xSUJjXhr.js +1 -0
- package/dist/assets/vendor-codemirror-lang-json-CLGxdOCz.js +1 -0
- package/dist/assets/vendor-codemirror-lang-less-6nXi1rS9.js +1 -0
- package/dist/assets/vendor-codemirror-lang-liquid-B9hmb9P8.js +1 -0
- package/dist/assets/vendor-codemirror-lang-markdown-DmFP9s6x.js +1 -0
- package/dist/assets/vendor-codemirror-lang-php-DC6To8iX.js +1 -0
- package/dist/assets/vendor-codemirror-lang-python-yuxIkjit.js +3 -0
- package/dist/assets/vendor-codemirror-lang-rust-di1Sjz-0.js +1 -0
- package/dist/assets/vendor-codemirror-lang-sass-BWpV9NPV.js +1 -0
- package/dist/assets/{vendor-codemirror-lang-sql-HpQWHJjv.js → vendor-codemirror-lang-sql-C_RazIaB.js} +2 -2
- package/dist/assets/vendor-codemirror-lang-vue-BYL0r7KR.js +1 -0
- package/dist/assets/vendor-codemirror-lang-wast-BiVarhcz.js +1 -0
- package/dist/assets/vendor-codemirror-lang-xml-Cn1lY1ts.js +1 -0
- package/dist/assets/vendor-codemirror-lang-yaml-BZ6mZw9L.js +1 -0
- package/dist/assets/vendor-codemirror-language-data-DglcKYWT.js +2 -0
- package/dist/assets/vendor-codemirror-search-DaE6R5gH.js +2 -0
- package/dist/assets/{vendor-elkjs-mzfkf0ML.js → vendor-elkjs-D27273Ms.js} +1 -1
- package/dist/assets/{vendor-heic2any-BHsbokcA.js → vendor-heic2any-pq-UTQQR.js} +1 -1
- package/dist/assets/vendor-lezer-cpp-Dt99h3WT.js +1 -0
- package/dist/assets/vendor-lezer-css-DNU_fzPI.js +1 -0
- package/dist/assets/vendor-lezer-go-BEFtcNyS.js +1 -0
- package/dist/assets/vendor-lezer-html-DDGRhRUz.js +1 -0
- package/dist/assets/vendor-lezer-java-DmfZtW09.js +1 -0
- package/dist/assets/vendor-lezer-javascript-oje4tdp_.js +1 -0
- package/dist/assets/vendor-lezer-json-BRXb_bDX.js +1 -0
- package/dist/assets/vendor-lezer-lr-BU2qmu_5.js +1 -0
- package/dist/assets/{vendor-lezer-markdown-C6g-d6P3.js → vendor-lezer-markdown-CicYv7V9.js} +4 -4
- package/dist/assets/vendor-lezer-php-COORrTpE.js +1 -0
- package/dist/assets/vendor-lezer-python-Cuvm9X9Y.js +1 -0
- package/dist/assets/vendor-lezer-rust-C_zOfHbX.js +1 -0
- package/dist/assets/vendor-lezer-sass-DWP4w7O1.js +1 -0
- package/dist/assets/vendor-lezer-xml-Br6nOYeG.js +1 -0
- package/dist/assets/vendor-lezer-yaml-CYQmm6Sb.js +1 -0
- package/dist/assets/{vendor-lru_map-Cy8fTs3_.js → vendor-lru_map-DOPmc7GU.js} +1 -1
- package/dist/assets/{vendor-qrcode-B0KNSajT.js → vendor-qrcode-Dv4uniC1.js} +1 -1
- package/dist/assets/vendor-react-DASdDPIk.js +1 -0
- package/dist/assets/{vendor-react-drawio-BYDptOsj.js → vendor-react-drawio-Duu5LgQA.js} +1 -1
- package/dist/assets/{vendor-replit-codemirror-vim-DaSwPsXt.js → vendor-replit-codemirror-vim-CZy3BUVv.js} +15 -15
- package/dist/assets/vendor-zustand-CUi8eEds.js +6 -0
- package/dist/assets/{web-components-CCKlju0Z.js → web-components-CH3-XV-n.js} +4 -4
- package/dist/index.html +7 -9
- package/dist/mini-chat.html +6 -8
- package/dist/mobile.html +6 -8
- package/package.json +1 -1
- package/server/index.js +3 -1
- package/server/lib/fs/DOCUMENTATION.md +1 -1
- package/server/lib/fs/routes.js +1 -50
- package/server/lib/git/DOCUMENTATION.md +18 -11
- package/server/lib/git/index.js +8 -3
- package/server/lib/git/routes.js +0 -129
- package/server/lib/git/service.js +40 -152
- package/server/lib/git/service.test.js +42 -18
- package/server/lib/github/DOCUMENTATION.md +271 -0
- package/server/lib/github/cache.js +164 -0
- package/server/lib/github/checks.js +230 -0
- package/server/lib/github/client.js +305 -0
- package/server/lib/github/context.js +177 -0
- package/server/lib/github/contracts.test.js +235 -0
- package/server/lib/github/correctness.test.js +356 -0
- package/server/lib/github/credential.js +46 -0
- package/server/lib/github/errors.js +151 -0
- package/server/lib/github/gh-cli.js +336 -0
- package/server/lib/github/index.js +27 -0
- package/server/lib/github/issues.js +495 -0
- package/server/lib/github/pulls.js +699 -0
- package/server/lib/github/repo-scope.js +688 -0
- package/server/lib/github/routes.js +599 -0
- package/server/lib/github/security.test.js +275 -0
- package/server/lib/github/templates.js +153 -0
- package/server/lib/package-manager-detect-child.js +12 -0
- package/server/lib/package-manager.js +366 -92
- package/server/lib/package-manager.test.js +109 -0
- package/server/lib/pi/routes-extension-events.test.js +268 -4
- package/server/lib/pi/routes.js +109 -25
- package/server/lib/pi/routes.test.js +118 -0
- package/server/lib/pi/session-daemon/DOCUMENTATION.md +5 -3
- package/server/lib/pi/session-daemon/extension-bridge-draft.test.js +222 -0
- package/server/lib/pi/session-daemon/extension-bridge.js +415 -42
- package/server/lib/pi/session-daemon/extension-name.js +87 -0
- package/server/lib/pi/session-daemon/extension-name.test.js +143 -0
- package/server/lib/pi/session-daemon/extension-theme.js +142 -0
- package/server/lib/pi/session-daemon/extension-theme.test.js +117 -0
- package/server/lib/pi/session-daemon/extension-tool-render.js +365 -0
- package/server/lib/pi/session-daemon/extension-tool-render.test.js +607 -0
- package/server/lib/pi/session-daemon/session-daemon-extensions.test.js +322 -2
- package/server/lib/pi/session-daemon/session-daemon-list-live.test.js +244 -0
- package/server/lib/pi/session-daemon/session-daemon.js +204 -33
- package/server/lib/pi/session-daemon/session-daemon.test.js +218 -0
- package/server/lib/pi/ui-settings-store.js +1 -1
- package/server/lib/static-cache-control.js +18 -0
- package/server/lib/static-cache-control.test.js +25 -0
- package/server/lib/workspace/host.js +2 -0
- package/dist/assets/DiagramView-Bj1ZrdhI.js +0 -1
- package/dist/assets/FileSaveConflictDialog-2Z4V_gZU.js +0 -3
- package/dist/assets/FilesView-K18gBSws.js +0 -6
- package/dist/assets/GitView-Hm1KBPaD.js +0 -8
- package/dist/assets/JsonTreeView-fNsiZEIo.js +0 -1
- package/dist/assets/PatchDiff-DZaJG6jj.js +0 -1
- package/dist/assets/SessionSwitcherContent-RAsmsuYk.js +0 -1
- package/dist/assets/SessionSwitcherDropdown-DuLPlIF_.js +0 -2
- package/dist/assets/SessionUnreadDot-Dm6k5OCd.js +0 -1
- package/dist/assets/SettingsView-Chu4zbWo.js +0 -6
- package/dist/assets/SettingsWindow-CJzFmmfu.js +0 -1
- package/dist/assets/ToolOutputDialog-uYeXsAGc.js +0 -8
- package/dist/assets/ToolPartDiffPreview-DnAHVRs-.js +0 -1
- package/dist/assets/Virtualizer-BSHVMKgK.js +0 -1
- package/dist/assets/collapsible-BH1vXEAI.js +0 -1
- package/dist/assets/computeVirtualFileMetrics-DXkR5jdw.js +0 -3
- package/dist/assets/gitStatusPredicates-BW8heN1a.js +0 -134
- package/dist/assets/index-5fyXnZFi.css +0 -1
- package/dist/assets/index-BrgKwTb0.js +0 -1
- package/dist/assets/index-C-sV_9sb.js +0 -8
- package/dist/assets/isDiffPlainText-DZFr1Tta.js +0 -1
- package/dist/assets/isFilePlainText-KNpEMvb-.js +0 -1
- package/dist/assets/main-BPY2ug1A.js +0 -135
- package/dist/assets/main-BRIjzIRl.js +0 -2
- package/dist/assets/markdownCore-DYizLr1N.js +0 -3
- package/dist/assets/miniChat-Dva4MINl.js +0 -2
- package/dist/assets/mobile-6jNUNv_x.js +0 -2
- package/dist/assets/permissionStore-iKN1K2_x.js +0 -1
- package/dist/assets/renderElectronMiniChatApp-BIeBrZmO.js +0 -2
- package/dist/assets/renderMobileApp-BDCtZpeS.js +0 -11
- package/dist/assets/runtimeEndpointReset-DqdGOWp8.js +0 -53
- package/dist/assets/useAppFontEffects-BABx-DxZ.js +0 -6722
- package/dist/assets/usePushVisibilityBeacon-BciEu3HS.js +0 -10
- package/dist/assets/useSwitcherItems-C7_5TB_n.js +0 -1
- package/dist/assets/vendor-aria-hidden-DvXkyWUv.js +0 -1
- package/dist/assets/vendor-base-ui-DXSHfszQ.js +0 -1
- package/dist/assets/vendor-class-variance-authority-5VPnzWs2.js +0 -1
- package/dist/assets/vendor-cmdk-zXx6sGnS.js +0 -1
- package/dist/assets/vendor-codemirror-autocomplete-wd6iRebq.js +0 -1
- package/dist/assets/vendor-codemirror-commands-CNlncqrr.js +0 -1
- package/dist/assets/vendor-codemirror-lang-angular-DU_4KiiW.js +0 -1
- package/dist/assets/vendor-codemirror-lang-cpp-CmIT9Z5_.js +0 -1
- package/dist/assets/vendor-codemirror-lang-css-djiuoTi8.js +0 -1
- package/dist/assets/vendor-codemirror-lang-go-COZSwZYW.js +0 -7
- package/dist/assets/vendor-codemirror-lang-html-CKHqhW5R.js +0 -1
- package/dist/assets/vendor-codemirror-lang-java-CNMP5hyC.js +0 -1
- package/dist/assets/vendor-codemirror-lang-javascript-DuOEwJ3f.js +0 -13
- package/dist/assets/vendor-codemirror-lang-jinja-DaKn_b1k.js +0 -1
- package/dist/assets/vendor-codemirror-lang-json-CZ07HmNC.js +0 -1
- package/dist/assets/vendor-codemirror-lang-less-wJdQiDBf.js +0 -1
- package/dist/assets/vendor-codemirror-lang-liquid-0z48Roi8.js +0 -1
- package/dist/assets/vendor-codemirror-lang-markdown-DtcZDGqe.js +0 -1
- package/dist/assets/vendor-codemirror-lang-php-W8plS-JQ.js +0 -1
- package/dist/assets/vendor-codemirror-lang-python-DzzokVau.js +0 -3
- package/dist/assets/vendor-codemirror-lang-rust-C4ulBVpf.js +0 -1
- package/dist/assets/vendor-codemirror-lang-sass-BkZJYEwS.js +0 -1
- package/dist/assets/vendor-codemirror-lang-vue-DiBPljCc.js +0 -1
- package/dist/assets/vendor-codemirror-lang-wast-DoABsogh.js +0 -1
- package/dist/assets/vendor-codemirror-lang-xml-BhLJhOCH.js +0 -1
- package/dist/assets/vendor-codemirror-lang-yaml-D95i1Y5R.js +0 -1
- package/dist/assets/vendor-codemirror-language-BByA_dGF.js +0 -3
- package/dist/assets/vendor-codemirror-language-data-BB5mQv-R.js +0 -2
- package/dist/assets/vendor-codemirror-search-BV44140v.js +0 -2
- package/dist/assets/vendor-codemirror-state-CNWM3Q8V.js +0 -5
- package/dist/assets/vendor-codemirror-view-Ct4T37Ue.js +0 -4
- package/dist/assets/vendor-crelt-C8TCjufn.js +0 -1
- package/dist/assets/vendor-detect-node-es-l0sNRNKZ.js +0 -1
- package/dist/assets/vendor-dnd-kit-accessibility-DZKKhs9S.js +0 -1
- package/dist/assets/vendor-dnd-kit-core-C9qcAm_1.js +0 -5
- package/dist/assets/vendor-dnd-kit-sortable-D8ozj8M-.js +0 -1
- package/dist/assets/vendor-dnd-kit-utilities-DTY1C6ST.js +0 -1
- package/dist/assets/vendor-floating-ui-core-CXmKXOXc.js +0 -1
- package/dist/assets/vendor-floating-ui-dom-WyXykhNi.js +0 -1
- package/dist/assets/vendor-floating-ui-react-dom-BZOGXAGe.js +0 -1
- package/dist/assets/vendor-floating-ui-utils-BzXdqYpP.js +0 -1
- package/dist/assets/vendor-framer-motion-CfplGuM0.js +0 -1
- package/dist/assets/vendor-get-nonce-C-Z93AgS.js +0 -1
- package/dist/assets/vendor-lezer-common-B3-cUCR_.js +0 -1
- package/dist/assets/vendor-lezer-cpp-BleAU9o-.js +0 -1
- package/dist/assets/vendor-lezer-css-C5xB6jxd.js +0 -1
- package/dist/assets/vendor-lezer-go-CXK1UKk8.js +0 -1
- package/dist/assets/vendor-lezer-highlight-CDMHUZ74.js +0 -1
- package/dist/assets/vendor-lezer-html-C0I1p52t.js +0 -1
- package/dist/assets/vendor-lezer-java-D_zzj-NV.js +0 -1
- package/dist/assets/vendor-lezer-javascript-D7Tj24ot.js +0 -1
- package/dist/assets/vendor-lezer-json-Iaex0UN-.js +0 -1
- package/dist/assets/vendor-lezer-lr-bhwg1HMg.js +0 -1
- package/dist/assets/vendor-lezer-php-_DHrbsZG.js +0 -1
- package/dist/assets/vendor-lezer-python-CvuFxeZl.js +0 -1
- package/dist/assets/vendor-lezer-rust-Lqgd5SAo.js +0 -1
- package/dist/assets/vendor-lezer-sass-Dnm2lY4t.js +0 -1
- package/dist/assets/vendor-lezer-xml-hUDuAyS5.js +0 -1
- package/dist/assets/vendor-lezer-yaml-BNIl6S_O.js +0 -1
- package/dist/assets/vendor-marijn-find-cluster-break-DXwl3gUT.js +0 -1
- package/dist/assets/vendor-motion-dom-DhJ-sYS5.js +0 -1
- package/dist/assets/vendor-motion-l0sNRNKZ.js +0 -1
- package/dist/assets/vendor-motion-utils-CKEGc_YG.js +0 -1
- package/dist/assets/vendor-radix-ui-primitive-Dc_FVRD7.js +0 -1
- package/dist/assets/vendor-radix-ui-react-compose-refs-8xy6TJML.js +0 -1
- package/dist/assets/vendor-radix-ui-react-context-CFsX-AUC.js +0 -1
- package/dist/assets/vendor-radix-ui-react-dialog-D2yhEu2p.js +0 -5
- package/dist/assets/vendor-radix-ui-react-dismissable-layer-DrorBNg9.js +0 -1
- package/dist/assets/vendor-radix-ui-react-focus-guards-BfdFmL7c.js +0 -1
- package/dist/assets/vendor-radix-ui-react-focus-scope-D2BkImwt.js +0 -1
- package/dist/assets/vendor-radix-ui-react-id-D2kS9K1j.js +0 -1
- package/dist/assets/vendor-radix-ui-react-portal-YgCRIyi7.js +0 -1
- package/dist/assets/vendor-radix-ui-react-presence-D432pCMB.js +0 -1
- package/dist/assets/vendor-radix-ui-react-primitive-DkH8dMOR.js +0 -1
- package/dist/assets/vendor-radix-ui-react-slot-BIDFZX0-.js +0 -1
- package/dist/assets/vendor-radix-ui-react-use-callback-ref-BwDcSoGV.js +0 -1
- package/dist/assets/vendor-radix-ui-react-use-controllable-state-LiqmKSXO.js +0 -1
- package/dist/assets/vendor-radix-ui-react-use-effect-event-D94va83M.js +0 -1
- package/dist/assets/vendor-radix-ui-react-use-escape-keydown-DTkqjenV.js +0 -1
- package/dist/assets/vendor-radix-ui-react-use-layout-effect-C8Yrsaph.js +0 -1
- package/dist/assets/vendor-react-B5Z1Mdn3.js +0 -9
- package/dist/assets/vendor-react-remove-scroll-bar-CSAHp1YF.js +0 -38
- package/dist/assets/vendor-react-remove-scroll-vR1dy1aP.js +0 -4
- package/dist/assets/vendor-react-style-singleton-Ctw6HnYx.js +0 -1
- package/dist/assets/vendor-reselect-l0sNRNKZ.js +0 -1
- package/dist/assets/vendor-scheduler-7OC5HNn7.js +0 -1
- package/dist/assets/vendor-simplewebauthn-browser-VDA66rT_.js +0 -2
- package/dist/assets/vendor-sonner-BDtm25td.js +0 -1
- package/dist/assets/vendor-style-mod-NZ5MEPvj.js +0 -3
- package/dist/assets/vendor-tanstack-react-virtual-2skouoFw.js +0 -1
- package/dist/assets/vendor-tanstack-virtual-core-Dubg10g5.js +0 -1
- package/dist/assets/vendor-tslib-De9GV7Vy.js +0 -1
- package/dist/assets/vendor-use-callback-ref-CVVuCyLj.js +0 -1
- package/dist/assets/vendor-use-sidecar-Vv4V8Nd1.js +0 -1
- package/dist/assets/vendor-use-sync-external-store-D0AXkdQC.js +0 -1
- package/dist/assets/vendor-w3c-keyname-Vcq4gwWv.js +0 -1
- package/dist/assets/vendor-zustand-GVb4H8HE.js +0 -6
- package/server/lib/git/credentials.js +0 -41
- package/server/lib/git/identity-storage.js +0 -122
- /package/dist/assets/{vendor-katex-CNckGUMB.js → vendor-katex-DZG0Ov6p.js} +0 -0
- /package/dist/assets/{vendor-katex-Cp579UoJ.css → vendor-katex-css-Cp579UoJ.css} +0 -0
- /package/dist/assets/{vendor-xterm-xterm-CrXqRur4.js → vendor-xterm-xterm-B-qIQCd3.js} +0 -0
- /package/dist/assets/{vendor-xterm-xterm-DDGTF8rc.css → vendor-xterm-xterm-css-DDGTF8rc.css} +0 -0
package/server/lib/git/routes.js
CHANGED
|
@@ -37,75 +37,6 @@ export function registerGitRoutes(app) {
|
|
|
37
37
|
behind: 0,
|
|
38
38
|
});
|
|
39
39
|
|
|
40
|
-
app.get('/api/git/identities', async (req, res) => {
|
|
41
|
-
const { getProfiles } = await getGitLibraries();
|
|
42
|
-
try {
|
|
43
|
-
const profiles = getProfiles();
|
|
44
|
-
res.json(profiles);
|
|
45
|
-
} catch (error) {
|
|
46
|
-
console.error('Failed to list git identity profiles:', error);
|
|
47
|
-
res.status(500).json({ error: 'Failed to list git identity profiles' });
|
|
48
|
-
}
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
app.post('/api/git/identities', async (req, res) => {
|
|
52
|
-
const { createProfile } = await getGitLibraries();
|
|
53
|
-
try {
|
|
54
|
-
const profile = createProfile(req.body);
|
|
55
|
-
console.log(`Created git identity profile: ${profile.name} (${profile.id})`);
|
|
56
|
-
res.json(profile);
|
|
57
|
-
} catch (error) {
|
|
58
|
-
console.error('Failed to create git identity profile:', error);
|
|
59
|
-
res.status(400).json({ error: error.message || 'Failed to create git identity profile' });
|
|
60
|
-
}
|
|
61
|
-
});
|
|
62
|
-
|
|
63
|
-
app.put('/api/git/identities/:id', async (req, res) => {
|
|
64
|
-
const { updateProfile } = await getGitLibraries();
|
|
65
|
-
try {
|
|
66
|
-
const profile = updateProfile(req.params.id, req.body);
|
|
67
|
-
console.log(`Updated git identity profile: ${profile.name} (${profile.id})`);
|
|
68
|
-
res.json(profile);
|
|
69
|
-
} catch (error) {
|
|
70
|
-
console.error('Failed to update git identity profile:', error);
|
|
71
|
-
res.status(400).json({ error: error.message || 'Failed to update git identity profile' });
|
|
72
|
-
}
|
|
73
|
-
});
|
|
74
|
-
|
|
75
|
-
app.delete('/api/git/identities/:id', async (req, res) => {
|
|
76
|
-
const { deleteProfile } = await getGitLibraries();
|
|
77
|
-
try {
|
|
78
|
-
deleteProfile(req.params.id);
|
|
79
|
-
console.log(`Deleted git identity profile: ${req.params.id}`);
|
|
80
|
-
res.json({ success: true });
|
|
81
|
-
} catch (error) {
|
|
82
|
-
console.error('Failed to delete git identity profile:', error);
|
|
83
|
-
res.status(400).json({ error: error.message || 'Failed to delete git identity profile' });
|
|
84
|
-
}
|
|
85
|
-
});
|
|
86
|
-
|
|
87
|
-
app.get('/api/git/global-identity', async (req, res) => {
|
|
88
|
-
const { getGlobalIdentity } = await getGitLibraries();
|
|
89
|
-
try {
|
|
90
|
-
const identity = await getGlobalIdentity();
|
|
91
|
-
res.json(identity);
|
|
92
|
-
} catch (error) {
|
|
93
|
-
console.error('Failed to get global git identity:', error);
|
|
94
|
-
res.status(500).json({ error: 'Failed to get global git identity' });
|
|
95
|
-
}
|
|
96
|
-
});
|
|
97
|
-
|
|
98
|
-
app.get('/api/git/discover-credentials', async (req, res) => {
|
|
99
|
-
try {
|
|
100
|
-
const { discoverGitCredentials } = await import('./index.js');
|
|
101
|
-
const credentials = discoverGitCredentials();
|
|
102
|
-
res.json(credentials);
|
|
103
|
-
} catch (error) {
|
|
104
|
-
console.error('Failed to discover git credentials:', error);
|
|
105
|
-
res.status(500).json({ error: 'Failed to discover git credentials' });
|
|
106
|
-
}
|
|
107
|
-
});
|
|
108
|
-
|
|
109
40
|
app.get('/api/git/check', async (req, res) => {
|
|
110
41
|
const { isGitRepository } = await getGitLibraries();
|
|
111
42
|
try {
|
|
@@ -159,66 +90,6 @@ export function registerGitRoutes(app) {
|
|
|
159
90
|
}
|
|
160
91
|
});
|
|
161
92
|
|
|
162
|
-
app.get('/api/git/has-local-identity', async (req, res) => {
|
|
163
|
-
const { hasLocalIdentity } = await getGitLibraries();
|
|
164
|
-
try {
|
|
165
|
-
const directory = req.query.directory;
|
|
166
|
-
if (!directory) {
|
|
167
|
-
return res.status(400).json({ error: 'directory parameter is required' });
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
const hasLocal = await hasLocalIdentity(directory);
|
|
171
|
-
res.json({ hasLocalIdentity: hasLocal });
|
|
172
|
-
} catch (error) {
|
|
173
|
-
console.error('Failed to check local git identity:', error);
|
|
174
|
-
res.status(500).json({ error: 'Failed to check local git identity' });
|
|
175
|
-
}
|
|
176
|
-
});
|
|
177
|
-
|
|
178
|
-
app.post('/api/git/set-identity', async (req, res) => {
|
|
179
|
-
const { getProfile, setLocalIdentity, getGlobalIdentity } = await getGitLibraries();
|
|
180
|
-
try {
|
|
181
|
-
const directory = req.query.directory;
|
|
182
|
-
if (!directory) {
|
|
183
|
-
return res.status(400).json({ error: 'directory parameter is required' });
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
const { profileId } = req.body;
|
|
187
|
-
if (!profileId) {
|
|
188
|
-
return res.status(400).json({ error: 'profileId is required' });
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
let profile = null;
|
|
192
|
-
|
|
193
|
-
if (profileId === 'global') {
|
|
194
|
-
const globalIdentity = await getGlobalIdentity();
|
|
195
|
-
if (!globalIdentity?.userName || !globalIdentity?.userEmail) {
|
|
196
|
-
return res.status(404).json({ error: 'Global identity is not configured' });
|
|
197
|
-
}
|
|
198
|
-
profile = {
|
|
199
|
-
id: 'global',
|
|
200
|
-
name: 'Global Identity',
|
|
201
|
-
userName: globalIdentity.userName,
|
|
202
|
-
userEmail: globalIdentity.userEmail,
|
|
203
|
-
sshKey: globalIdentity.sshCommand
|
|
204
|
-
? globalIdentity.sshCommand.replace('ssh -i ', '')
|
|
205
|
-
: null,
|
|
206
|
-
};
|
|
207
|
-
} else {
|
|
208
|
-
profile = getProfile(profileId);
|
|
209
|
-
if (!profile) {
|
|
210
|
-
return res.status(404).json({ error: 'Profile not found' });
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
await setLocalIdentity(directory, profile);
|
|
215
|
-
res.json({ success: true, profile });
|
|
216
|
-
} catch (error) {
|
|
217
|
-
console.error('Failed to set git identity:', error);
|
|
218
|
-
res.status(500).json({ error: error.message || 'Failed to set git identity' });
|
|
219
|
-
}
|
|
220
|
-
});
|
|
221
|
-
|
|
222
93
|
app.get('/api/git/status', async (req, res) => {
|
|
223
94
|
const { getStatus, isGitRepository } = await getGitLibraries();
|
|
224
95
|
|
|
@@ -239,54 +239,6 @@ const resolveGitBinary = () => {
|
|
|
239
239
|
|
|
240
240
|
const getGitBinary = () => resolveGitBinary();
|
|
241
241
|
|
|
242
|
-
/**
|
|
243
|
-
* Escape an SSH key path for use in core.sshCommand.
|
|
244
|
-
* Handles Windows/Unix differences and prevents command injection.
|
|
245
|
-
*/
|
|
246
|
-
function escapeSshKeyPath(sshKeyPath) {
|
|
247
|
-
const isWindows = process.platform === 'win32';
|
|
248
|
-
|
|
249
|
-
// Normalize path first on Windows (convert backslashes to forward slashes)
|
|
250
|
-
let normalizedPath = sshKeyPath;
|
|
251
|
-
if (isWindows) {
|
|
252
|
-
normalizedPath = sshKeyPath.replace(/\\/g, '/');
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
// Validate: reject paths with characters that could enable injection
|
|
256
|
-
// Allow only alphanumeric, path separators, dots, dashes, underscores, spaces, and colons (for Windows drives)
|
|
257
|
-
// Note: backslash is not in this list since we've already normalized Windows paths
|
|
258
|
-
const dangerousChars = /[`$!"';&|<>(){}[\]*?#~]/;
|
|
259
|
-
if (dangerousChars.test(normalizedPath)) {
|
|
260
|
-
throw new Error(`SSH key path contains invalid characters: ${sshKeyPath}`);
|
|
261
|
-
}
|
|
262
|
-
|
|
263
|
-
if (isWindows) {
|
|
264
|
-
// On Windows, Git (via MSYS/MinGW) expects Unix-style paths
|
|
265
|
-
// Convert "C:/path" to "/c/path" for MSYS compatibility
|
|
266
|
-
let unixPath = normalizedPath;
|
|
267
|
-
const driveMatch = unixPath.match(/^([A-Za-z]):\//);
|
|
268
|
-
if (driveMatch) {
|
|
269
|
-
unixPath = `/${driveMatch[1].toLowerCase()}${unixPath.slice(2)}`;
|
|
270
|
-
}
|
|
271
|
-
|
|
272
|
-
// Use single quotes for the path (prevents shell interpretation)
|
|
273
|
-
return `'${unixPath}'`;
|
|
274
|
-
} else {
|
|
275
|
-
// On Unix, use single quotes and escape any single quotes in the path
|
|
276
|
-
// Single quotes prevent all shell interpretation except for single quotes themselves
|
|
277
|
-
const escaped = normalizedPath.replace(/'/g, "'\\''");
|
|
278
|
-
return `'${escaped}'`;
|
|
279
|
-
}
|
|
280
|
-
}
|
|
281
|
-
|
|
282
|
-
/**
|
|
283
|
-
* Build the SSH command string for git config
|
|
284
|
-
*/
|
|
285
|
-
function buildSshCommand(sshKeyPath) {
|
|
286
|
-
const escapedPath = escapeSshKeyPath(sshKeyPath);
|
|
287
|
-
return `ssh -i ${escapedPath} -o IdentitiesOnly=yes`;
|
|
288
|
-
}
|
|
289
|
-
|
|
290
242
|
const isSocketPath = async (candidate) => {
|
|
291
243
|
if (!candidate || typeof candidate !== 'string') {
|
|
292
244
|
return false;
|
|
@@ -342,10 +294,39 @@ const resolveSshAuthSock = async () => {
|
|
|
342
294
|
return null;
|
|
343
295
|
};
|
|
344
296
|
|
|
297
|
+
// Every git operation builds its env, and without SSH_AUTH_SOCK the lookup
|
|
298
|
+
// spawns gpgconf up to three times. Spawning blocks the server event loop for
|
|
299
|
+
// the fork, so memoize the result briefly (re-checking that a cached socket
|
|
300
|
+
// still exists) and share one in-flight lookup across concurrent git calls.
|
|
301
|
+
// A negative result expires too, so an agent started later is picked up.
|
|
302
|
+
const SSH_AUTH_SOCK_CACHE_TTL_MS = 60_000;
|
|
303
|
+
let sshAuthSockCache = null;
|
|
304
|
+
let sshAuthSockInFlight = null;
|
|
305
|
+
|
|
306
|
+
const resolveSshAuthSockCached = async () => {
|
|
307
|
+
if (sshAuthSockCache && sshAuthSockCache.expiresAt > Date.now()) {
|
|
308
|
+
const cached = sshAuthSockCache.value;
|
|
309
|
+
if (!cached || await isSocketPath(cached)) {
|
|
310
|
+
return cached;
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
if (!sshAuthSockInFlight) {
|
|
314
|
+
sshAuthSockInFlight = resolveSshAuthSock()
|
|
315
|
+
.then((value) => {
|
|
316
|
+
sshAuthSockCache = { value, expiresAt: Date.now() + SSH_AUTH_SOCK_CACHE_TTL_MS };
|
|
317
|
+
return value;
|
|
318
|
+
})
|
|
319
|
+
.finally(() => {
|
|
320
|
+
sshAuthSockInFlight = null;
|
|
321
|
+
});
|
|
322
|
+
}
|
|
323
|
+
return sshAuthSockInFlight;
|
|
324
|
+
};
|
|
325
|
+
|
|
345
326
|
const buildGitEnv = async () => {
|
|
346
327
|
const env = { ...process.env };
|
|
347
328
|
if (!env.SSH_AUTH_SOCK || !env.SSH_AUTH_SOCK.trim()) {
|
|
348
|
-
const resolved = await
|
|
329
|
+
const resolved = await resolveSshAuthSockCached();
|
|
349
330
|
if (resolved) {
|
|
350
331
|
env.SSH_AUTH_SOCK = resolved;
|
|
351
332
|
}
|
|
@@ -353,16 +334,13 @@ const buildGitEnv = async () => {
|
|
|
353
334
|
return env;
|
|
354
335
|
};
|
|
355
336
|
|
|
356
|
-
const createGit = async (directory
|
|
337
|
+
const createGit = async (directory) => {
|
|
357
338
|
const env = await buildGitEnv();
|
|
358
339
|
const spawnOptions = { windowsHide: true };
|
|
359
340
|
const binary = getGitBinary();
|
|
360
341
|
const hasCustomBinary = typeof binary === 'string' && binary.trim() && binary !== 'git' && binary !== 'git.exe';
|
|
361
|
-
const unsafe = hasCustomBinary
|
|
362
|
-
? {
|
|
363
|
-
...(hasCustomBinary && { allowUnsafeCustomBinary: true }),
|
|
364
|
-
...(allowUnsafeSshCommand && { allowUnsafeSshCommand: true }),
|
|
365
|
-
}
|
|
342
|
+
const unsafe = hasCustomBinary
|
|
343
|
+
? { allowUnsafeCustomBinary: true }
|
|
366
344
|
: undefined;
|
|
367
345
|
// Always pin simple-git to an explicit working directory. Omitting baseDir
|
|
368
346
|
// makes simple-git use process.cwd(), which breaks when the PiChamber
|
|
@@ -382,10 +360,6 @@ const createGit = async (directory, { allowUnsafeSshCommand = false } = {}) => {
|
|
|
382
360
|
});
|
|
383
361
|
};
|
|
384
362
|
|
|
385
|
-
// Global config reads do not need a repository; use the home directory as a
|
|
386
|
-
// stable baseDir so we never accidentally inherit process.cwd().
|
|
387
|
-
const createGitForGlobalConfig = async () => createGit(os.homedir());
|
|
388
|
-
|
|
389
363
|
const normalizeDirectoryPath = (value) => {
|
|
390
364
|
if (typeof value !== 'string') {
|
|
391
365
|
return value;
|
|
@@ -1958,29 +1932,6 @@ export async function isGitRepository(directory) {
|
|
|
1958
1932
|
return result.success;
|
|
1959
1933
|
}
|
|
1960
1934
|
|
|
1961
|
-
export async function getGlobalIdentity() {
|
|
1962
|
-
const git = await createGitForGlobalConfig();
|
|
1963
|
-
|
|
1964
|
-
try {
|
|
1965
|
-
const userName = await git.getConfig('user.name', 'global').catch(() => null);
|
|
1966
|
-
const userEmail = await git.getConfig('user.email', 'global').catch(() => null);
|
|
1967
|
-
const sshCommand = await git.getConfig('core.sshCommand', 'global').catch(() => null);
|
|
1968
|
-
|
|
1969
|
-
return {
|
|
1970
|
-
userName: userName?.value || null,
|
|
1971
|
-
userEmail: userEmail?.value || null,
|
|
1972
|
-
sshCommand: sshCommand?.value || null
|
|
1973
|
-
};
|
|
1974
|
-
} catch (error) {
|
|
1975
|
-
console.error('Failed to get global Git identity:', error);
|
|
1976
|
-
return {
|
|
1977
|
-
userName: null,
|
|
1978
|
-
userEmail: null,
|
|
1979
|
-
sshCommand: null
|
|
1980
|
-
};
|
|
1981
|
-
}
|
|
1982
|
-
}
|
|
1983
|
-
|
|
1984
1935
|
export async function getRemoteUrl(directory, remoteName = 'origin') {
|
|
1985
1936
|
const git = await createGit(directory);
|
|
1986
1937
|
|
|
@@ -1996,87 +1947,24 @@ export async function getCurrentIdentity(directory) {
|
|
|
1996
1947
|
const git = await createGit(directory);
|
|
1997
1948
|
|
|
1998
1949
|
try {
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
);
|
|
2003
|
-
|
|
2004
|
-
const userEmail = await git.getConfig('user.email', 'local').catch(() =>
|
|
2005
|
-
git.getConfig('user.email', 'global')
|
|
2006
|
-
);
|
|
2007
|
-
|
|
2008
|
-
const sshCommand = await git.getConfig('core.sshCommand', 'local').catch(() =>
|
|
2009
|
-
git.getConfig('core.sshCommand', 'global')
|
|
2010
|
-
);
|
|
1950
|
+
// Effective config (local > global > system, honoring includeIf) is what
|
|
1951
|
+
// `git commit` uses. A scoped read returns `value: null` for an unset key
|
|
1952
|
+
// instead of throwing, so a local-then-global fallback never falls back.
|
|
1953
|
+
const userName = await git.getConfig('user.name');
|
|
1954
|
+
const userEmail = await git.getConfig('user.email');
|
|
2011
1955
|
|
|
2012
1956
|
return {
|
|
2013
1957
|
userName: userName?.value || null,
|
|
2014
|
-
userEmail: userEmail?.value || null
|
|
2015
|
-
sshCommand: sshCommand?.value || null
|
|
1958
|
+
userEmail: userEmail?.value || null
|
|
2016
1959
|
};
|
|
2017
1960
|
} catch (error) {
|
|
2018
1961
|
console.error('Failed to get current Git identity:', error);
|
|
2019
1962
|
return {
|
|
2020
1963
|
userName: null,
|
|
2021
|
-
userEmail: null
|
|
2022
|
-
sshCommand: null
|
|
1964
|
+
userEmail: null
|
|
2023
1965
|
};
|
|
2024
1966
|
}
|
|
2025
1967
|
}
|
|
2026
|
-
|
|
2027
|
-
export async function hasLocalIdentity(directory) {
|
|
2028
|
-
const git = await createGit(directory);
|
|
2029
|
-
|
|
2030
|
-
try {
|
|
2031
|
-
const localName = await git.getConfig('user.name', 'local').catch(() => null);
|
|
2032
|
-
const localEmail = await git.getConfig('user.email', 'local').catch(() => null);
|
|
2033
|
-
return Boolean(localName?.value || localEmail?.value);
|
|
2034
|
-
} catch {
|
|
2035
|
-
return false;
|
|
2036
|
-
}
|
|
2037
|
-
}
|
|
2038
|
-
|
|
2039
|
-
export async function setLocalIdentity(directory, profile) {
|
|
2040
|
-
const git = await createGit(directory, { allowUnsafeSshCommand: true });
|
|
2041
|
-
|
|
2042
|
-
try {
|
|
2043
|
-
|
|
2044
|
-
await git.addConfig('user.name', profile.userName, false, 'local');
|
|
2045
|
-
await git.addConfig('user.email', profile.userEmail, false, 'local');
|
|
2046
|
-
|
|
2047
|
-
const authType = profile.authType || 'ssh';
|
|
2048
|
-
|
|
2049
|
-
if (authType === 'ssh' && profile.sshKey) {
|
|
2050
|
-
await git.raw([
|
|
2051
|
-
'config',
|
|
2052
|
-
'--local',
|
|
2053
|
-
'core.sshCommand',
|
|
2054
|
-
buildSshCommand(profile.sshKey)
|
|
2055
|
-
]);
|
|
2056
|
-
await git.raw(['config', '--local', '--unset', 'credential.helper']).catch(() => {});
|
|
2057
|
-
} else if (authType === 'token' && profile.host) {
|
|
2058
|
-
await git.addConfig(
|
|
2059
|
-
'credential.helper',
|
|
2060
|
-
'store',
|
|
2061
|
-
false,
|
|
2062
|
-
'local'
|
|
2063
|
-
);
|
|
2064
|
-
await git.raw(['config', '--local', '--unset', 'core.sshCommand']).catch(() => {});
|
|
2065
|
-
}
|
|
2066
|
-
|
|
2067
|
-
if (profile.signCommits === true && typeof profile.signingKey === 'string' && profile.signingKey.trim()) {
|
|
2068
|
-
await git.addConfig('gpg.format', 'ssh', false, 'local');
|
|
2069
|
-
await git.addConfig('user.signingkey', profile.signingKey.trim(), false, 'local');
|
|
2070
|
-
await git.addConfig('commit.gpgsign', 'true', false, 'local');
|
|
2071
|
-
}
|
|
2072
|
-
|
|
2073
|
-
return true;
|
|
2074
|
-
} catch (error) {
|
|
2075
|
-
console.error('Failed to set Git identity:', error);
|
|
2076
|
-
throw error;
|
|
2077
|
-
}
|
|
2078
|
-
}
|
|
2079
|
-
|
|
2080
1968
|
export async function getStatus(directory, options = {}) {
|
|
2081
1969
|
const lightMode = options.mode === 'light';
|
|
2082
1970
|
const normalizedDirectory = normalizeDirectoryPath(directory);
|
|
@@ -13,6 +13,7 @@ import {
|
|
|
13
13
|
getWorktreeBootstrapStatus,
|
|
14
14
|
getWorktrees,
|
|
15
15
|
getBranches,
|
|
16
|
+
getCurrentIdentity,
|
|
16
17
|
getRangeDiff,
|
|
17
18
|
getRemotes,
|
|
18
19
|
getStatus,
|
|
@@ -24,7 +25,6 @@ import {
|
|
|
24
25
|
resetToCommit,
|
|
25
26
|
resolveBaseRefForLog,
|
|
26
27
|
revertCommit,
|
|
27
|
-
setLocalIdentity,
|
|
28
28
|
stageFiles,
|
|
29
29
|
unstageFiles,
|
|
30
30
|
applyHunk,
|
|
@@ -103,6 +103,47 @@ async function createTempRepo() {
|
|
|
103
103
|
return { tmpDir, git };
|
|
104
104
|
}
|
|
105
105
|
|
|
106
|
+
// ---------------------------------------------------------------------------
|
|
107
|
+
// getCurrentIdentity
|
|
108
|
+
// ---------------------------------------------------------------------------
|
|
109
|
+
|
|
110
|
+
describe.skipIf(!canRunGit())('getCurrentIdentity', () => {
|
|
111
|
+
const withGlobalConfig = async (entries, run) => {
|
|
112
|
+
const globalConfig = path.join(createTempDir(), 'gitconfig');
|
|
113
|
+
fs.writeFileSync(globalConfig, '');
|
|
114
|
+
for (const [key, value] of entries) {
|
|
115
|
+
execFileSync('git', ['config', '--file', globalConfig, key, value]);
|
|
116
|
+
}
|
|
117
|
+
const previous = process.env.GIT_CONFIG_GLOBAL;
|
|
118
|
+
process.env.GIT_CONFIG_GLOBAL = globalConfig;
|
|
119
|
+
try {
|
|
120
|
+
return await run();
|
|
121
|
+
} finally {
|
|
122
|
+
if (previous === undefined) delete process.env.GIT_CONFIG_GLOBAL;
|
|
123
|
+
else process.env.GIT_CONFIG_GLOBAL = previous;
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
it('falls back to the global author when the repository sets none', async () => {
|
|
128
|
+
const repository = createTempDir();
|
|
129
|
+
runGit(repository, ['init']);
|
|
130
|
+
const identity = await withGlobalConfig(
|
|
131
|
+
[['user.name', 'Global User'], ['user.email', 'global@example.com']],
|
|
132
|
+
() => getCurrentIdentity(repository),
|
|
133
|
+
);
|
|
134
|
+
expect(identity).toEqual({ userName: 'Global User', userEmail: 'global@example.com' });
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
it('prefers the repository author over the global one', async () => {
|
|
138
|
+
const { tmpDir } = await createTempRepo();
|
|
139
|
+
const identity = await withGlobalConfig(
|
|
140
|
+
[['user.name', 'Global User'], ['user.email', 'global@example.com']],
|
|
141
|
+
() => getCurrentIdentity(tmpDir),
|
|
142
|
+
);
|
|
143
|
+
expect(identity).toEqual({ userName: 'Test User', userEmail: 'test@example.com' });
|
|
144
|
+
});
|
|
145
|
+
});
|
|
146
|
+
|
|
106
147
|
// ---------------------------------------------------------------------------
|
|
107
148
|
// resolveBaseRefForLog
|
|
108
149
|
// ---------------------------------------------------------------------------
|
|
@@ -157,23 +198,6 @@ describe('git index path validation', () => {
|
|
|
157
198
|
});
|
|
158
199
|
});
|
|
159
200
|
|
|
160
|
-
describe.runIf(canRunGit())('setLocalIdentity', () => {
|
|
161
|
-
it('configures the local SSH command with the targeted simple-git opt-in', async () => {
|
|
162
|
-
const { tmpDir } = await createTempRepo();
|
|
163
|
-
|
|
164
|
-
await setLocalIdentity(tmpDir, {
|
|
165
|
-
userName: 'SSH User',
|
|
166
|
-
userEmail: 'ssh@example.com',
|
|
167
|
-
authType: 'ssh',
|
|
168
|
-
sshKey: '/tmp/test key',
|
|
169
|
-
});
|
|
170
|
-
|
|
171
|
-
expect(runGit(tmpDir, ['config', '--local', '--get', 'core.sshCommand']).trim()).toBe(
|
|
172
|
-
"ssh -i '/tmp/test key' -o IdentitiesOnly=yes"
|
|
173
|
-
);
|
|
174
|
-
});
|
|
175
|
-
});
|
|
176
|
-
|
|
177
201
|
// ---------------------------------------------------------------------------
|
|
178
202
|
// applyHunk (per-hunk stage / unstage / discard)
|
|
179
203
|
// ---------------------------------------------------------------------------
|