@scolladon/tsgit 2.0.1 → 3.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (154) hide show
  1. package/README.md +14 -2
  2. package/dist/cjs/adapters/browser/index.cjs +1 -2
  3. package/dist/cjs/adapters/memory/index.cjs +1 -2
  4. package/dist/cjs/adapters/node/index.cjs +1 -2
  5. package/dist/cjs/chunks/adapter-detect-DW9fsw9d.cjs +1 -0
  6. package/dist/cjs/chunks/browser-http-transport-DGwW5YL7.cjs +1 -0
  7. package/dist/cjs/chunks/context-BcoAzPuU.cjs +0 -1
  8. package/dist/cjs/chunks/error-CfLWDui_.cjs +1 -0
  9. package/dist/cjs/chunks/index-Cy44GVR6.cjs +1 -0
  10. package/dist/cjs/chunks/inflate-CmCtM4-w.cjs +1 -0
  11. package/dist/cjs/chunks/lru-cache-1OU7JhD8.cjs +0 -1
  12. package/dist/cjs/chunks/memory-http-transport-CGriODcQ.cjs +1 -0
  13. package/dist/cjs/chunks/node-ssh-transport-PFu3ijfp.cjs +1 -0
  14. package/dist/cjs/chunks/{progress-CxU62NC1.cjs → progress-D8Dqbftk.cjs} +1 -2
  15. package/dist/cjs/chunks/readable-stream-MTA6D0Zh.cjs +0 -1
  16. package/dist/cjs/chunks/repository-Ci-BBxk0.cjs +1 -0
  17. package/dist/cjs/chunks/write-sparse-checkout-C1dsHCAD.cjs +1 -0
  18. package/dist/cjs/commands/index.cjs +1 -2
  19. package/dist/cjs/index.browser.cjs +1 -2
  20. package/dist/cjs/index.cjs +1 -2
  21. package/dist/cjs/index.default.cjs +1 -2
  22. package/dist/cjs/index.node.cjs +1 -2
  23. package/dist/cjs/operators/index.cjs +0 -1
  24. package/dist/cjs/primitives/index.cjs +1 -2
  25. package/dist/cjs/transport/index.cjs +0 -1
  26. package/dist/esm/adapters/browser/index.js +1 -2
  27. package/dist/esm/adapters/memory/index.js +1 -2
  28. package/dist/esm/adapters/node/index.js +1 -2
  29. package/dist/esm/chunks/adapter-detect-BkCMnjrI.js +1 -0
  30. package/dist/esm/chunks/browser-http-transport-CSxAte5h.js +1 -0
  31. package/dist/esm/chunks/context-CumKOV7K.js +0 -1
  32. package/dist/esm/chunks/error-BotOd-nD.js +1 -0
  33. package/dist/esm/chunks/index-DsvINN8n.js +1 -0
  34. package/dist/esm/chunks/inflate-BCIXqeeE.js +1 -0
  35. package/dist/esm/chunks/lru-cache-Cy7C7Lx2.js +0 -1
  36. package/dist/esm/chunks/memory-http-transport-caqmMGR1.js +1 -0
  37. package/dist/esm/chunks/node-ssh-transport-BgSv2IhT.js +1 -0
  38. package/dist/esm/chunks/{progress-BZobfl7p.js → progress-B_AJnOHx.js} +1 -2
  39. package/dist/esm/chunks/readable-stream-CGuf8k1J.js +0 -1
  40. package/dist/esm/chunks/repository-DyxknzvE.js +1 -0
  41. package/dist/esm/chunks/write-sparse-checkout-BwHbNKNS.js +1 -0
  42. package/dist/esm/commands/index.js +1 -2
  43. package/dist/esm/index.browser.js +1 -2
  44. package/dist/esm/index.default.js +1 -2
  45. package/dist/esm/index.js +1 -2
  46. package/dist/esm/index.node.js +1 -2
  47. package/dist/esm/operators/index.js +0 -1
  48. package/dist/esm/primitives/index.js +1 -2
  49. package/dist/esm/transport/index.js +0 -1
  50. package/dist/types/adapters/browser/index.d.cts +5 -3
  51. package/dist/types/adapters/browser/index.d.ts +5 -3
  52. package/dist/types/adapters/memory/index.d.cts +31 -4
  53. package/dist/types/adapters/memory/index.d.ts +31 -4
  54. package/dist/types/adapters/node/index.d.cts +146 -40
  55. package/dist/types/adapters/node/index.d.ts +146 -40
  56. package/dist/types/chunks/{context-YDw6qicq.d.cts → context-CF1YF2S8.d.cts} +165 -6
  57. package/dist/types/chunks/{context-CCL0_F8R.d.ts → context-sIhhtk2u.d.ts} +165 -6
  58. package/dist/types/chunks/{http-transport--_NdQOiw.d.cts → http-transport-DirKfK2S.d.cts} +1 -1
  59. package/dist/types/chunks/{http-transport--_NdQOiw.d.ts → http-transport-DirKfK2S.d.ts} +1 -1
  60. package/dist/types/chunks/index-B5Dps3fg.d.ts +2468 -0
  61. package/dist/types/chunks/index-B_A8VLaf.d.ts +1221 -0
  62. package/dist/types/chunks/index-Dfh8cvEs.d.cts +2468 -0
  63. package/dist/types/chunks/index-Dqxddhav.d.cts +1221 -0
  64. package/dist/types/chunks/progress-BjAKfkam.d.ts +1217 -0
  65. package/dist/types/chunks/progress-Ldnfb8st.d.cts +1217 -0
  66. package/dist/types/chunks/reflog-entry-Cqh3QrPH.d.ts +697 -0
  67. package/dist/types/chunks/reflog-entry-Dy-O27Dd.d.cts +697 -0
  68. package/dist/types/chunks/{repository-FoS_Laoy.d.ts → repository-D8QBTkEz.d.ts} +58 -20
  69. package/dist/types/chunks/{repository-BeifCqp0.d.cts → repository-D9YrVhcH.d.cts} +58 -20
  70. package/dist/types/commands/index.d.cts +4 -1259
  71. package/dist/types/commands/index.d.ts +4 -1259
  72. package/dist/types/index.browser.d.cts +7 -8
  73. package/dist/types/index.browser.d.ts +7 -8
  74. package/dist/types/index.d.cts +61 -124
  75. package/dist/types/index.d.ts +61 -124
  76. package/dist/types/index.default.d.cts +7 -8
  77. package/dist/types/index.default.d.ts +7 -8
  78. package/dist/types/index.node.d.cts +7 -8
  79. package/dist/types/index.node.d.ts +7 -8
  80. package/dist/types/primitives/index.d.cts +4 -692
  81. package/dist/types/primitives/index.d.ts +4 -692
  82. package/dist/types/transport/index.d.cts +1 -1
  83. package/dist/types/transport/index.d.ts +1 -1
  84. package/package.json +94 -28
  85. package/dist/cjs/adapters/browser/index.cjs.map +0 -1
  86. package/dist/cjs/adapters/memory/index.cjs.map +0 -1
  87. package/dist/cjs/adapters/node/index.cjs.map +0 -1
  88. package/dist/cjs/chunks/adapter-detect-CD_LcgaH.cjs +0 -2
  89. package/dist/cjs/chunks/adapter-detect-CD_LcgaH.cjs.map +0 -1
  90. package/dist/cjs/chunks/browser-http-transport-CiMRqtDS.cjs +0 -2
  91. package/dist/cjs/chunks/browser-http-transport-CiMRqtDS.cjs.map +0 -1
  92. package/dist/cjs/chunks/context-BcoAzPuU.cjs.map +0 -1
  93. package/dist/cjs/chunks/error-CfjFO3x_.cjs +0 -2
  94. package/dist/cjs/chunks/error-CfjFO3x_.cjs.map +0 -1
  95. package/dist/cjs/chunks/index-BWCq_5BJ.cjs +0 -2
  96. package/dist/cjs/chunks/index-BWCq_5BJ.cjs.map +0 -1
  97. package/dist/cjs/chunks/lru-cache-1OU7JhD8.cjs.map +0 -1
  98. package/dist/cjs/chunks/memory-http-transport-BVL6VgB-.cjs +0 -2
  99. package/dist/cjs/chunks/memory-http-transport-BVL6VgB-.cjs.map +0 -1
  100. package/dist/cjs/chunks/node-http-transport-BvfVcf02.cjs +0 -2
  101. package/dist/cjs/chunks/node-http-transport-BvfVcf02.cjs.map +0 -1
  102. package/dist/cjs/chunks/progress-CxU62NC1.cjs.map +0 -1
  103. package/dist/cjs/chunks/readable-stream-MTA6D0Zh.cjs.map +0 -1
  104. package/dist/cjs/chunks/repository-BEg2zNtx.cjs +0 -2
  105. package/dist/cjs/chunks/repository-BEg2zNtx.cjs.map +0 -1
  106. package/dist/cjs/chunks/walk-submodules-D2Sp7JEB.cjs +0 -2
  107. package/dist/cjs/chunks/walk-submodules-D2Sp7JEB.cjs.map +0 -1
  108. package/dist/cjs/commands/index.cjs.map +0 -1
  109. package/dist/cjs/index.browser.cjs.map +0 -1
  110. package/dist/cjs/index.cjs.map +0 -1
  111. package/dist/cjs/index.default.cjs.map +0 -1
  112. package/dist/cjs/index.node.cjs.map +0 -1
  113. package/dist/cjs/operators/index.cjs.map +0 -1
  114. package/dist/cjs/primitives/index.cjs.map +0 -1
  115. package/dist/cjs/transport/index.cjs.map +0 -1
  116. package/dist/esm/adapters/browser/index.js.map +0 -1
  117. package/dist/esm/adapters/memory/index.js.map +0 -1
  118. package/dist/esm/adapters/node/index.js.map +0 -1
  119. package/dist/esm/chunks/adapter-detect-DkZhhUhd.js +0 -2
  120. package/dist/esm/chunks/adapter-detect-DkZhhUhd.js.map +0 -1
  121. package/dist/esm/chunks/browser-http-transport-4rJkHcQu.js +0 -2
  122. package/dist/esm/chunks/browser-http-transport-4rJkHcQu.js.map +0 -1
  123. package/dist/esm/chunks/context-CumKOV7K.js.map +0 -1
  124. package/dist/esm/chunks/error-Dc-SRSJK.js +0 -2
  125. package/dist/esm/chunks/error-Dc-SRSJK.js.map +0 -1
  126. package/dist/esm/chunks/index-jH0UMhh-.js +0 -2
  127. package/dist/esm/chunks/index-jH0UMhh-.js.map +0 -1
  128. package/dist/esm/chunks/lru-cache-Cy7C7Lx2.js.map +0 -1
  129. package/dist/esm/chunks/memory-http-transport-CA1WxWBp.js +0 -2
  130. package/dist/esm/chunks/memory-http-transport-CA1WxWBp.js.map +0 -1
  131. package/dist/esm/chunks/node-http-transport-DPa2lK3T.js +0 -2
  132. package/dist/esm/chunks/node-http-transport-DPa2lK3T.js.map +0 -1
  133. package/dist/esm/chunks/progress-BZobfl7p.js.map +0 -1
  134. package/dist/esm/chunks/readable-stream-CGuf8k1J.js.map +0 -1
  135. package/dist/esm/chunks/repository-DF6ePd1x.js +0 -2
  136. package/dist/esm/chunks/repository-DF6ePd1x.js.map +0 -1
  137. package/dist/esm/chunks/walk-submodules-Dq9oGwP8.js +0 -2
  138. package/dist/esm/chunks/walk-submodules-Dq9oGwP8.js.map +0 -1
  139. package/dist/esm/commands/index.js.map +0 -1
  140. package/dist/esm/index.browser.js.map +0 -1
  141. package/dist/esm/index.default.js.map +0 -1
  142. package/dist/esm/index.js.map +0 -1
  143. package/dist/esm/index.node.js.map +0 -1
  144. package/dist/esm/operators/index.js.map +0 -1
  145. package/dist/esm/primitives/index.js.map +0 -1
  146. package/dist/esm/transport/index.js.map +0 -1
  147. package/dist/types/chunks/index-entry-DtEbVpOG.d.cts +0 -47
  148. package/dist/types/chunks/index-entry-UD4dvtKh.d.ts +0 -47
  149. package/dist/types/chunks/progress-7KKiXXfX.d.ts +0 -405
  150. package/dist/types/chunks/progress-By8yFaUE.d.cts +0 -405
  151. package/dist/types/chunks/reflog-entry-BbNnXCTC.d.cts +0 -368
  152. package/dist/types/chunks/reflog-entry-CSzjnZd4.d.ts +0 -368
  153. package/dist/types/chunks/write-tree-C3oNxOlX.d.cts +0 -196
  154. package/dist/types/chunks/write-tree-DRI-LzSr.d.ts +0 -196
package/README.md CHANGED
@@ -21,7 +21,7 @@ import { openRepository } from '@scolladon/tsgit';
21
21
 
22
22
  const repo = await openRepository({ cwd: process.cwd() });
23
23
  const commits = await repo.log({ limit: 10 });
24
- const { clean, branch, indexChanges, workingTreeChanges } = await repo.status();
24
+ const { clean, branch, changes, untracked } = await repo.status();
25
25
  await repo.dispose();
26
26
  ```
27
27
 
@@ -43,13 +43,25 @@ await repo.dispose();
43
43
  - Cross-runtime — Node 22+ · Deno · Bun · Cloudflare Workers · Browser (OPFS) · in-memory
44
44
  - Tree-shakeable — `sideEffects: false`; each primitive is an independent entry
45
45
  - CJS + ESM dual-publish, verified by `arethetypeswrong`
46
- - 30 Tier-1 commands · 20+ AsyncIterable primitives · operator toolkit (`pipe`, `filter`, `map`, …)
46
+ - 43 Tier-1 commands · 20+ AsyncIterable primitives · operator toolkit (`pipe`, `filter`, `map`, …)
47
47
  - Snapshot+join surface — query tree / index / workdir / stash through one lazy, atomic-iteration pipeline ([primer](docs/use/snapshots.md))
48
48
  - Type-safe — branded `ObjectId`/`RefName`/`FilePath`, discriminated-union errors, no `any`
49
49
  - AbortSignal lifetime — `repo.dispose()` cancels in-flight work
50
50
 
51
51
  → [Commands](docs/use/commands/) · [primitives](docs/use/primitives/) · [snapshots](docs/use/snapshots.md) · [errors](docs/use/errors.md)
52
52
 
53
+ ## Why tsgit
54
+
55
+ Competitive with `isomorphic-git`, the mainstream pure-TypeScript git library — faster on some paths, slower on others (notably cold-cache / clean-tree reads, where tsgit pays a security-containment `lstat` cost it is working to amortise):
56
+
57
+ | Scenario | tsgit vs isomorphic-git |
58
+ |---|---|
59
+ | `status` (dirty tree) | **1.22× faster** |
60
+ | `clone` (small repo) | 1.09× (parity) |
61
+ | `readBlob` (cold cache) | 0.70× (slower) |
62
+
63
+ _Measured on a GitHub Actions runner; ±20% variance — trust direction, not absolute numbers._ → [Full benchmarks + methodology](docs/understand/performance.md)
64
+
53
65
  ## Documentation
54
66
 
55
67
  - 📖 [Get started](docs/get-started/) — Node, browser, memory, migration from isomorphic-git
@@ -1,2 +1 @@
1
- "use strict";var r=require("../../chunks/lru-cache-1OU7JhD8.cjs"),e=require("../../chunks/context-BcoAzPuU.cjs"),s=require("../../chunks/progress-CxU62NC1.cjs"),o=require("../../chunks/browser-http-transport-CiMRqtDS.cjs");require("../../chunks/error-CfjFO3x_.cjs"),exports.BrowserCompressor=o.BrowserCompressor,exports.BrowserFileSystem=o.BrowserFileSystem,exports.BrowserHashService=o.BrowserHashService,exports.BrowserHttpTransport=o.BrowserHttpTransport,exports.createBrowserContext=function(t){const a=t.gitDirName??".git",n=r.createLruCache(t.deltaCacheMaxBytes??16777216,t.deltaCacheMaxEntries??65536),c={fs:new o.BrowserFileSystem(t.rootHandle),hash:new o.BrowserHashService,compressor:new o.BrowserCompressor,transport:new o.BrowserHttpTransport,progress:s.noopProgress,layout:{workDir:"/",gitDir:`/${a}`,bare:t.bare??!1},hashConfig:r.SHA1_CONFIG,deltaCache:n,...void 0!==t.signal?{signal:t.signal}:{}};return e.createContext(c)};
2
- //# sourceMappingURL=index.cjs.map
1
+ "use strict";var r=require("../../chunks/lru-cache-1OU7JhD8.cjs"),e=require("../../chunks/context-BcoAzPuU.cjs"),s=require("../../chunks/progress-D8Dqbftk.cjs"),o=require("../../chunks/browser-http-transport-DGwW5YL7.cjs");require("../../chunks/error-CfLWDui_.cjs"),require("../../chunks/inflate-CmCtM4-w.cjs"),exports.BrowserCompressor=o.BrowserCompressor,exports.BrowserFileSystem=o.BrowserFileSystem,exports.BrowserHashService=o.BrowserHashService,exports.BrowserHttpTransport=o.BrowserHttpTransport,exports.createBrowserContext=function(t){const a=t.gitDirName??".git",n=r.createLruCache(t.deltaCacheMaxBytes??16777216,t.deltaCacheMaxEntries??65536),c={fs:new o.BrowserFileSystem(t.rootHandle),hash:new o.BrowserHashService,compressor:new o.BrowserCompressor,transport:new o.BrowserHttpTransport,progress:s.noopProgress,layout:{workDir:"/",gitDir:`/${a}`,bare:t.bare??!1},runtime:"browser",hashConfig:r.SHA1_CONFIG,deltaCache:n,...void 0!==t.signal?{signal:t.signal}:{}};return e.createContext(c)};
@@ -1,2 +1 @@
1
- "use strict";var e=require("../../chunks/lru-cache-1OU7JhD8.cjs"),r=require("../../chunks/context-BcoAzPuU.cjs"),o=require("../../chunks/progress-CxU62NC1.cjs"),s=require("../../chunks/memory-http-transport-BVL6VgB-.cjs");require("../../chunks/error-CfjFO3x_.cjs");const t="/repo",i="/repo/.git",c={kind:"skipped"};exports.MemoryCompressor=s.MemoryCompressor,exports.MemoryFileSystem=s.MemoryFileSystem,exports.MemoryHashService=s.MemoryHashService,exports.MemoryHttpTransport=s.MemoryHttpTransport,exports.MemoryHookRunner=class{outcomes;recorded=[];constructor(e={}){this.outcomes=e}get calls(){return this.recorded}run(e){return this.recorded.push(e),Promise.resolve(this.outcomes[e.name]??c)}},exports.createMemoryContext=function(c={}){const n={rootDir:t,...void 0!==c.files?{files:c.files}:{},...void 0!==c.home?{home:c.home}:{},...void 0!==c.xdg?{xdg:c.xdg}:{},...void 0!==c.systemConfig?{systemConfig:c.systemConfig}:{}},m=new s.MemoryFileSystem(n),a=c.algorithm??"sha1",h=new s.MemoryHashService(a),p=new s.MemoryCompressor,u=new s.MemoryHttpTransport,y=void 0===c.homeDir?{workDir:t,gitDir:i,bare:!1}:{workDir:t,gitDir:i,bare:!1,homeDir:c.homeDir},d="sha256"===a?e.SHA256_CONFIG:e.SHA1_CONFIG,l=e.createLruCache(c.deltaCacheMaxBytes??16777216,c.deltaCacheMaxEntries??65536),g={fs:m,hash:h,compressor:p,transport:u,progress:o.noopProgress,layout:y,hashConfig:d,deltaCache:l,...void 0!==c.signal?{signal:c.signal}:{},...void 0!==c.hooks?{hooks:c.hooks}:{}};return r.createContext(g)};
2
- //# sourceMappingURL=index.cjs.map
1
+ "use strict";var e=require("../../chunks/lru-cache-1OU7JhD8.cjs"),r=require("../../chunks/context-BcoAzPuU.cjs"),o=require("../../chunks/progress-D8Dqbftk.cjs"),s=require("../../chunks/memory-http-transport-CGriODcQ.cjs");require("../../chunks/error-CfLWDui_.cjs"),require("../../chunks/inflate-CmCtM4-w.cjs");const t="/repo",i="/repo/.git",n={kind:"skipped"};exports.MemoryCompressor=s.MemoryCompressor,exports.MemoryFileSystem=s.MemoryFileSystem,exports.MemoryHashService=s.MemoryHashService,exports.MemoryHttpTransport=s.MemoryHttpTransport,exports.MemoryCommandRunner=class{behaviour;recorded=[];constructor(e=()=>0){this.behaviour=e}get calls(){return this.recorded}async run(e){return this.recorded.push(e),{exitCode:await this.behaviour(e)}}},exports.MemoryHookRunner=class{outcomes;recorded=[];constructor(e={}){this.outcomes=e}get calls(){return this.recorded}run(e){return this.recorded.push(e),Promise.resolve(this.outcomes[e.name]??n)}},exports.createMemoryContext=function(n={}){const c={rootDir:t,...void 0!==n.files?{files:n.files}:{},...void 0!==n.home?{home:n.home}:{},...void 0!==n.xdg?{xdg:n.xdg}:{},...void 0!==n.systemConfig?{systemConfig:n.systemConfig}:{}},m=new s.MemoryFileSystem(c),a=n.algorithm??"sha1",h=new s.MemoryHashService(a),u=new s.MemoryCompressor,d=new s.MemoryHttpTransport,p=void 0===n.homeDir?{workDir:t,gitDir:i,bare:!1}:{workDir:t,gitDir:i,bare:!1,homeDir:n.homeDir},y="sha256"===a?e.SHA256_CONFIG:e.SHA1_CONFIG,l=e.createLruCache(n.deltaCacheMaxBytes??16777216,n.deltaCacheMaxEntries??65536),v={fs:m,hash:h,compressor:u,transport:d,progress:o.noopProgress,layout:p,runtime:"memory",hashConfig:y,deltaCache:l,...void 0!==n.signal?{signal:n.signal}:{},...void 0!==n.hooks?{hooks:n.hooks}:{},...void 0!==n.command?{command:n.command}:{},...void 0!==n.env?{env:n.env}:{}};return r.createContext(v)};
@@ -1,2 +1 @@
1
- "use strict";var e=require("node:os"),r=require("node:path"),o=require("../../chunks/lru-cache-1OU7JhD8.cjs"),t=require("../../chunks/context-BcoAzPuU.cjs"),s=require("../../chunks/progress-CxU62NC1.cjs"),n=require("../../chunks/node-http-transport-BvfVcf02.cjs");function i(e){var r=Object.create(null);return e&&Object.keys(e).forEach(function(o){if("default"!==o){var t=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(r,o,t.get?t:{enumerable:!0,get:function(){return e[o]}})}}),r.default=e,Object.freeze(r)}require("../../chunks/error-CfjFO3x_.cjs"),require("node:zlib"),require("node:fs"),require("node:fs/promises"),require("node:crypto"),require("node:child_process"),require("node:http"),require("node:https"),require("node:stream");var a=i(r);exports.NodeCompressor=n.NodeCompressor,exports.NodeFileSystem=n.NodeFileSystem,exports.NodeHashService=n.NodeHashService,exports.NodeHookRunner=n.NodeHookRunner,exports.NodeHttpTransport=n.NodeHttpTransport,exports.createNodeContext=function(r){const i=a.resolve(r.workDir),c=void 0!==r.gitDir?a.resolve(r.gitDir):a.join(i,".git"),u=new n.NodeFileSystem(i),d=new n.NodeHashService,p=new n.NodeCompressor,h=new n.NodeHttpTransport({allowInsecureHttp:r.allowInsecureHttp??!1}),l=((e,r,o,t)=>void 0===t?{workDir:e,gitDir:r,bare:o}:{workDir:e,gitDir:r,bare:o,homeDir:t})(i,c,r.bare??!1,""===(q=e.homedir())?void 0:q),N=o.createLruCache(r.deltaCacheMaxBytes??16777216,r.deltaCacheMaxEntries??65536),g={fs:u,hash:d,compressor:p,transport:h,progress:s.noopProgress,layout:l,hashConfig:o.SHA1_CONFIG,deltaCache:N,...void 0!==r.signal?{signal:r.signal}:{},...!1===r.hooks?{}:{hooks:new n.NodeHookRunner}};var q;return t.createContext(g)};
2
- //# sourceMappingURL=index.cjs.map
1
+ "use strict";var e=require("node:os"),r=require("node:path"),o=require("../../chunks/lru-cache-1OU7JhD8.cjs"),n=require("../../chunks/context-BcoAzPuU.cjs"),s=require("../../chunks/progress-D8Dqbftk.cjs"),t=require("../../chunks/node-ssh-transport-PFu3ijfp.cjs");function i(e){var r=Object.create(null);return e&&Object.keys(e).forEach(function(o){if("default"!==o){var n=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(r,o,n.get?n:{enumerable:!0,get:function(){return e[o]}})}}),r.default=e,Object.freeze(r)}require("../../chunks/error-CfLWDui_.cjs"),require("node:child_process"),require("node:zlib"),require("node:fs"),require("node:stream/promises"),require("node:fs/promises"),require("node:crypto"),require("node:http"),require("node:https"),require("node:stream");var a=i(r);exports.NodeCommandRunner=t.NodeCommandRunner,exports.NodeCompressor=t.NodeCompressor,exports.NodeFileSystem=t.NodeFileSystem,exports.NodeHashService=t.NodeHashService,exports.NodeHookRunner=t.NodeHookRunner,exports.NodeHttpTransport=t.NodeHttpTransport,exports.realCommandRunnerOps=t.realCommandRunnerOps,exports.createNodeContext=function(r){const i=a.resolve(r.workDir),d=void 0!==r.gitDir?a.resolve(r.gitDir):a.join(i,".git"),u=new t.NodeFileSystem(i),c=new t.NodeHashService,p=new t.NodeCompressor,h=new t.NodeHttpTransport({allowInsecureHttp:r.allowInsecureHttp??!1}),m=((e,r,o,n)=>void 0===n?{workDir:e,gitDir:r,bare:o}:{workDir:e,gitDir:r,bare:o,homeDir:n})(i,d,r.bare??!1,""===(q=e.homedir())?void 0:q),l=o.createLruCache(r.deltaCacheMaxBytes??16777216,r.deltaCacheMaxEntries??65536),N={fs:u,hash:c,compressor:p,transport:h,progress:s.noopProgress,layout:m,runtime:"node",hashConfig:o.SHA1_CONFIG,deltaCache:l,...void 0!==r.signal?{signal:r.signal}:{},...!1===r.hooks?{}:{hooks:new t.NodeHookRunner},...!1===r.command?{}:{command:new t.NodeCommandRunner},...!1===r.ssh?{}:{ssh:new t.NodeSshTransport},env:new t.NodeEnvReader};var q;return n.createContext(N)};
@@ -0,0 +1 @@
1
+ "use strict";var e=require("./error-CfLWDui_.cjs");const o=Object.freeze({}),r=(e,o)=>"object"==typeof e&&null!==e&&Object.hasOwn(e,o),t=()=>{const e=globalThis.process;return!!r(e,"versions")&&r(e.versions,"node")},n=()=>r(globalThis,"window")&&"undefined"!=typeof window&&r(globalThis,"navigator")&&"undefined"!=typeof navigator;exports.detectRuntime=()=>t()?"node":n()?"browser":"memory",exports.isBrowser=n,exports.isNode=t,exports.noopLogger=o,exports.wrapLoggerSanitizer=o=>{const r=o=>(r,t)=>{try{const n=e.sanitize(r),i=void 0!==t?(o=>{const r={};for(const[t,n]of Object.entries(o))r[t]="string"==typeof n?e.sanitize(n):n;return r})(t):void 0;o(n,i)}catch{}},t={};return void 0!==o.debug&&(t.debug=r(o.debug)),void 0!==o.info&&(t.info=r(o.info)),void 0!==o.warn&&(t.warn=r(o.warn)),void 0!==o.error&&(t.error=r(o.error)),Object.freeze(t)};
@@ -0,0 +1 @@
1
+ "use strict";var t=require("./inflate-CmCtM4-w.cjs"),e=require("./error-CfLWDui_.cjs");function r(t,r){const a=t[t.length-1];if(void 0===a)throw e.fileNotFound(r);return a}function a(t){return t instanceof e.TsgitError&&"FILE_NOT_FOUND"===t.data.code}function i(t,e,r){return{ctimeMs:e,mtimeMs:e,dev:0,ino:0,mode:r?33188:16877,uid:0,gid:0,size:t,isFile:r,isDirectory:!r,isSymbolicLink:!1}}function s(t){let e="";for(const r of t)e+=r.toString(16).padStart(2,"0");return e}exports.BrowserCompressor=class{async deflate(t,r){try{const e=new Blob([t]).stream().pipeThrough(new CompressionStream("deflate"));return new Uint8Array(await new Response(e).arrayBuffer())}catch(t){throw e.compressFailed(t instanceof Error?t.message:String(t))}}async deflateRaw(t,r){try{const e=new Blob([t]).stream().pipeThrough(new CompressionStream("deflate-raw"));return new Uint8Array(await new Response(e).arrayBuffer())}catch(t){throw e.compressFailed(t instanceof Error?t.message:String(t))}}async inflate(t){try{const e=new DecompressionStream("deflate"),r=new Blob([t]).stream().pipeTo(e.writable).catch(()=>{}),a=new Uint8Array(await new Response(e.readable).arrayBuffer());return await r,a}catch(t){throw e.decompressFailed(t instanceof Error?t.message:String(t))}}async streamInflate(e,r){return t.inflateZlibMember(e,r)}createInflateStream(){return new DecompressionStream("deflate")}},exports.BrowserFileSystem=class{rootHandle;constructor(t){this.rootHandle=t}async read(t){const e=await this.resolveFileHandle(t,!1),r=await e.getFile();return new Uint8Array(await r.arrayBuffer())}async readSlice(t,r,a){if(r<0||a<0)throw e.permissionDenied(t);const i=await this.resolveFileHandle(t,!1),s=(await i.getFile()).slice(r,r+a);return new Uint8Array(await s.arrayBuffer())}async readUtf8(t){const e=await this.resolveFileHandle(t,!1);return(await e.getFile()).text()}async write(t,e){const r=await this.resolveFileHandle(t,!0),a=await r.createWritable();await a.write(e),await a.close()}async writeStream(t,e){const r=await this.resolveFileHandle(t,!0),a=await r.createWritable();for await(const t of e)await a.write(t);await a.close()}async writeExclusive(t,a){const i=this.splitPath(t);if(0===i.length)throw e.permissionDenied(t);const s=await this.walkToParent(i,!0),o=r(i,t);await this.assertDoesNotExist(s,o,t);const n=await s.getFileHandle(o,{create:!0}),c=await n.createWritable();await c.write(a),await c.close()}async writeUtf8(t,e){await this.write(t,(new TextEncoder).encode(e))}async appendUtf8(t,e){const r=await this.resolveFileHandle(t,!0),a=await r.getFile(),i=await r.createWritable({keepExistingData:!0});await i.write({type:"write",position:a.size,data:e}),await i.close()}async exists(t){try{return await this.resolveFileHandle(t,!1),!0}catch(e){if(a(e))try{return await this.resolveDirHandle(t,!1),!0}catch{return!1}throw e}}async stat(t){try{const e=await this.resolveFileHandle(t,!1),r=await e.getFile();return i(r.size,r.lastModified,!0)}catch(e){if(!a(e))throw e;return await this.resolveDirHandle(t,!1),i(0,Date.now(),!1)}}async lstat(t){return this.stat(t)}async readdir(t){const e=[],r=await this.resolveDirHandle(t,!1);for await(const[t,a]of r.entries())e.push({name:t,isFile:"file"===a.kind,isDirectory:"directory"===a.kind,isSymbolicLink:!1});return e}async mkdir(t){const e=this.splitPath(t);let r=this.rootHandle;for(const t of e)r=await r.getDirectoryHandle(t,{create:!0})}async rm(t){const a=this.splitPath(t);if(0===a.length)throw e.permissionDenied(t);const i=await this.walkToParent(a,!1),s=r(a,t);try{await i.removeEntry(s)}catch{throw e.fileNotFound(t)}}async rename(t,e){const r=await this.read(t);await this.write(e,r),await this.rm(t)}async readlink(t){throw e.unsupportedOperation("readlink","OPFS does not support symbolic links")}async symlink(t,r){throw e.unsupportedOperation("symlink","OPFS does not support symbolic links")}async chmod(t,e){try{await this.resolveFileHandle(t,!1)}catch(e){if(!a(e))throw e;await this.resolveDirHandle(t,!1)}}async rmRecursive(t){const i=this.splitPath(t);if(0===i.length)throw e.permissionDenied(t);const s=await this.walkToParent(i,!1).catch(t=>{if(!a(t))throw t});if(void 0===s)return;const o=r(i,t);try{await s.removeEntry(o,{recursive:!0})}catch{}}async openWithNoFollow(t,r){throw e.unsupportedOperation("openWithNoFollow","browser FS does not support O_NOFOLLOW")}homedir(){throw e.unsupportedOperation("homedir","browser adapter has no concept of a home directory")}xdgConfigHome(){throw e.unsupportedOperation("xdgConfigHome","browser adapter has no XDG config home")}systemConfigPath(){throw e.unsupportedOperation("systemConfigPath","browser adapter has no system config path")}splitPath(t){const r=t.replace(/^\/+/,"").split("/").filter(t=>""!==t&&"."!==t);for(const a of r)if(".."===a)throw e.permissionDenied(t);return r}async resolveFileHandle(t,a){const i=this.splitPath(t);if(0===i.length)throw e.fileNotFound(t);const s=await this.walkToParent(i,a),o=r(i,t);try{return await s.getFileHandle(o,{create:a})}catch(r){if(r instanceof e.TsgitError)throw r;throw e.fileNotFound(t)}}async resolveDirHandle(t,a){const i=this.splitPath(t);if(0===i.length)return this.rootHandle;const s=await this.walkToParent(i,a),o=r(i,t);try{return await s.getDirectoryHandle(o,{create:a})}catch(r){if(r instanceof e.TsgitError)throw r;throw e.fileNotFound(t)}}async walkToParent(t,r){let a=this.rootHandle;for(let i=0;i<t.length-1;i++){const s=t[i];if(void 0===s)throw e.fileNotFound(t.join("/"));try{a=await a.getDirectoryHandle(s,{create:r})}catch(r){if(r instanceof e.TsgitError)throw r;throw e.fileNotFound(t.join("/"))}}return a}async assertDoesNotExist(t,r,a){try{await t.getFileHandle(r,{create:!1})}catch(t){if(t instanceof e.TsgitError)throw t;return}throw e.fileExists(a)}},exports.BrowserHashService=class{algorithm;digestLength;constructor(t="sha1"){if(!globalThis.crypto?.subtle)throw e.hashFailed("crypto.subtle unavailable");this.algorithm=t,this.digestLength="sha1"===t?20:32}async hash(t){return new Uint8Array(await crypto.subtle.digest(this.algoName,t))}async hashHex(t){return s(await this.hash(t))}createHasher(){const t=[],r=this.algoName;let a=!1;const i=async()=>{if(a)throw e.hashFailed("cannot digest after digest");a=!0;const i=t.reduce((t,e)=>t+e.length,0),s=new Uint8Array(i);let o=0;for(const e of t)s.set(e,o),o+=e.length;return new Uint8Array(await crypto.subtle.digest(r,s))};return{update(r){if(a)throw e.hashFailed("cannot update after digest");t.push(r.slice())},digest:i,digestHex:async()=>s(await i())}}get algoName(){return"sha1"===this.algorithm?"SHA-1":"SHA-256"}},exports.BrowserHttpTransport=class{async request(t){try{const e={method:t.method,headers:{...t.headers}};void 0!==t.body&&(e.body=t.body),void 0!==t.signal&&(e.signal=t.signal);const r=await fetch(t.url,e),a={};r.headers.forEach((t,e)=>{a[e.toLowerCase()]=t});const i=r.body??new ReadableStream;return{statusCode:r.status,headers:a,body:i}}catch(t){throw e.networkError(t instanceof Error?t.message:String(t))}}};
@@ -1,2 +1 @@
1
1
  "use strict";exports.createContext=function(e){return Object.freeze({...e,cwd:e.cwd??e.layout.workDir})};
2
- //# sourceMappingURL=context-BcoAzPuU.cjs.map
@@ -0,0 +1 @@
1
+ "use strict";class e extends Error{data;name="TsgitError";constructor(e){super(`${e.code}: ${function(e){switch(e.code){case"INVALID_OBJECT_ID":case"INVALID_FILE_MODE":return e.value;case"INVALID_OBJECT_HEADER":case"INVALID_TREE_ENTRY":case"INVALID_COMMIT":case"INVALID_TAG":case"INVALID_IDENTITY":case"INVALID_PACK_HEADER":case"INVALID_PACK_INDEX":case"INVALID_PACK_ENTRY":case"INVALID_DELTA":case"INVALID_REF":case"INVALID_PACKED_REFS":case"INVALID_INDEX_HEADER":case"INVALID_INDEX_ENTRY":return e.reason;case"FILE_NOT_FOUND":return`file not found: ${t(e.path)}`;case"FILE_EXISTS":return`file already exists: ${t(e.path)}`;case"NOT_A_DIRECTORY":return`not a directory: ${t(e.path)}`;case"DIRECTORY_NOT_EMPTY":return`directory not empty: ${t(e.path)}`;case"PERMISSION_DENIED":return`permission denied: ${t(e.path)}`;case"UNSUPPORTED_OPERATION":return`unsupported operation: ${e.operation}: ${e.reason}`;case"HASH_FAILED":return`hash computation failed: ${e.reason}`;case"COMPRESS_FAILED":return`compression failed: ${e.reason}`;case"DECOMPRESS_FAILED":return`decompression failed: ${e.reason}`;case"HTTP_ERROR":return`HTTP ${e.statusCode}: ${e.reason}`;case"NETWORK_ERROR":return`network error: ${e.reason}`;case"INVALID_TREE_FOR_DIFF":return`invalid tree for diff: ${e.reason}`;case"INVALID_DIFF_INPUT":return`invalid diff input: ${e.reason}`;case"INVALID_MERGE_TREE":return`invalid merge tree: ${e.reason}`;case"INVALID_MERGE_INPUT":return`invalid merge input: ${e.reason}`;case"OBJECT_NOT_FOUND":return`object not found: ${e.id}`;case"OBJECT_HASH_MISMATCH":return`object hash mismatch: expected=${e.expected} actual=${e.actual}`;case"UNEXPECTED_OBJECT_TYPE":return`unexpected object type: expected=${e.expected} actual=${e.actual} id=${e.id}`;case"TREE_CYCLE_DETECTED":return`tree cycle detected: ${e.id}`;case"TREE_DEPTH_EXCEEDED":return`tree depth exceeded: ${e.depth}`;case"TREE_ENTRY_LIMIT_EXCEEDED":return`tree entry limit exceeded: count=${e.count} limit=${e.limit}`;case"OBJECT_TOO_LARGE":return`object too large: id=${e.id} size=${e.actualSize} limit=${e.limit}`;case"DELTA_CHAIN_TOO_DEEP":return`delta chain too deep: ${e.depth}`;case"REF_NOT_FOUND":return`ref not found: ${e.name}`;case"REF_CHAIN_TOO_DEEP":return`ref chain too deep: depth=${e.depth} chain=${e.chain.join("->")}`;case"REF_CYCLE_DETECTED":return`ref cycle detected: ${e.chain.join("->")}`;case"REF_LOCKED":return`ref locked: ${e.name}`;case"REF_UPDATE_CONFLICT":return`ref update conflict: name=${e.name} expected=${e.expected} actual=${e.actual}`;case"INVALID_WALK_INPUT":return`invalid walk input: ${e.reason}`;case"OPERATION_ABORTED":return"operation aborted";case"INVALID_PKT_LENGTH":return`invalid pkt-line length: ${e.value}`;case"PKT_LENGTH_RESERVED":return`reserved pkt-line length: ${e.value}`;case"PKT_TOO_LARGE":return`pkt-line too large: ${e.value} bytes (max 65520)`;case"PKT_TRUNCATED":return`pkt-line truncated: ${e.remaining} bytes remaining`;case"INVALID_BASE_URL":return`invalid base URL: ${e.reason}`;case"MISSING_SERVICE_HEADER":return`missing service header: expected=${e.expected} actual=${e.actual}`;case"MISSING_CAPABILITIES":return"missing capabilities in advertisement";case"INVALID_REF_LINE":return`invalid ref line: ${e.line}`;case"DUPLICATE_REF":return`duplicate ref: ${e.name}`;case"INVALID_SIDEBAND_CHANNEL":return`invalid sideband channel: ${e.channel}`;case"SIDEBAND_FATAL":return`sideband fatal: ${e.message}`;case"UNKNOWN_ACK_STATUS":return`unknown ack status: ${e.value}`;case"INVALID_REPORT_STATUS":return`invalid report-status line: ${e.line}`;case"EMPTY_WANTS":return"upload-pack request has no wants";case"EMPTY_RECEIVE_UPDATES":return"receive-pack request has no updates";case"TOO_MANY_ADVERTISED_REFS":return`advertised refs (${e.count}) exceed limit ${e.limit}`;case"RESOURCE_LOCKED":return`${e.resource} locked: ${t(e.path)}`;case"PACK_TOO_LARGE":return`pack contains ${e.objectCount} objects, exceeds limit ${e.limit}`;case"NOT_A_REPOSITORY":return`not a git repository: ${t(e.path)}`;case"BARE_REPOSITORY":return`operation requires a working tree: ${e.operation}`;case"ALREADY_INITIALIZED":return`repository already exists: ${t(e.path)}`;case"WORKING_TREE_DIRTY":return`working tree has uncommitted changes: ${e.localChanges.length+e.untracked.length} files`;case"PATHSPEC_NO_MATCH":return`pathspec did not match any files: ${e.pattern}`;case"PATHSPEC_OUTSIDE_REPO":return`pathspec resolves outside repository: ${t(e.path)}`;case"NOTHING_TO_COMMIT":return"nothing to commit (use allowEmpty: true to commit anyway)";case"EMPTY_COMMIT_MESSAGE":return"commit message is empty (use allowEmptyMessage: true to commit anyway)";case"AUTHOR_UNCONFIGURED":return"author identity not configured (set ctx.config.user or pass author/committer)";case"BRANCH_EXISTS":return`branch already exists: ${e.name}`;case"BRANCH_NOT_FOUND":return`branch not found: ${e.name}`;case"TAG_EXISTS":return`tag already exists: ${e.name}`;case"TAG_NOT_FOUND":return`tag not found: ${e.name}`;case"CANNOT_DELETE_CHECKED_OUT_BRANCH":return`cannot delete branch currently checked out: ${e.name}`;case"INVALID_URL":return`invalid URL: ${e.reason}`;case"BLOCKED_HOST":return`host blocked: ${e.host} (${e.reason})`;case"TOO_MANY_REDIRECTS":return`too many redirects: ${e.count}`;case"UNSUPPORTED_SCHEME":return`unsupported URL scheme: ${e.scheme}`;case"TARGET_DIRECTORY_NOT_EMPTY":return`target directory is not empty: ${t(e.path)}`;case"REMOTE_ADVERTISES_NO_REFS":return"remote advertised no refs";case"NON_FAST_FORWARD":return`non-fast-forward update for ${e.ref}: local=${e.local} remote=${e.remote}`;case"PUSH_REJECTED":return`push rejected for ${e.ref}: ${e.reason}`;case"MERGE_HAS_CONFLICTS":return`merge has unresolved conflicts: ${e.count} files`;case"CHECKOUT_OVERWRITE_DIRTY":return`checkout would overwrite uncommitted changes: ${e.localChanges.length+e.untracked.length} files`;case"REVPARSE_AMBIGUOUS":return`revision expression "${e.expression}" is ambiguous (${e.candidates.length} candidates)`;case"REVPARSE_UNRESOLVED":return`cannot resolve revision: ${e.expression}`;case"PATH_NOT_IN_TREE":return`path '${e.path}' does not exist in '${e.rev}'`;case"WORKTREE_FILE_ABSENT":return`cannot read working-tree file '${e.path}'`;case"EMPTY_PATHSPEC":return'pathspec is empty (use "." to mean "all paths")';case"OPERATION_IN_PROGRESS":return`${e.operation} in progress; complete or abort it before running this command`;case"NO_OPERATION_IN_PROGRESS":return`no ${e.operation} in progress`;case"MAX_REFSPECS_EXCEEDED":return`${e.count} refspecs exceeds limit ${e.limit}`;case"REMOTE_NOT_CONFIGURED":return`remote not configured: ${e.remote}`;case"NO_UPSTREAM_CONFIGURED":return`no upstream configured for ${e.branch}`;case"REMOTE_EXISTS":return`remote already exists: ${e.remote}`;case"REMOTE_NAME_INVALID":return`invalid remote name "${e.name}": ${e.reason}`;case"NO_PROMISOR_REMOTE":return"no promisor remote configured; this repository is not a partial clone";case"REFSPEC_INVALID":return`invalid refspec "${e.raw}": ${e.reason}`;case"INVALID_OPTION":return`invalid option: ${e.option} — ${e.reason}`;case"REPOSITORY_DISPOSED":return"repository has been disposed; create a new one with openRepository()";case"ADAPTER_UNAVAILABLE":return`adapter unavailable for runtime ${e.runtime}: ${e.reason}`;case"WORKING_TREE_FILE_TOO_LARGE":return`working-tree file too large: ${t(e.path)} size=${e.size} limit=${e.limit}`;case"GITIGNORE_FILE_TOO_LARGE":return`.gitignore too large: ${t(e.path)} size=${e.size} limit=${e.limit}`;case"GITATTRIBUTES_FILE_TOO_LARGE":return`.gitattributes too large: ${t(e.path)} size=${e.size} limit=${e.limit}`;case"SPARSE_PATTERN_FILE_TOO_LARGE":return`sparse-checkout file too large: ${t(e.path)} size=${e.size} limit=${e.limit}`;case"INVALID_REFLOG_ENTRY":return`invalid reflog entry: ${e.reason}`;case"REFLOG_NOT_FOUND":return`reflog not found: ${e.ref}`;case"REFLOG_ENTRY_OUT_OF_RANGE":return`reflog entry out of range: ref=${e.ref} requested=${e.requested} available=${e.available}`;case"HOOK_FAILED":return`hook ${e.hook} failed with exit code ${e.exitCode}`;case"CLEAN_FILTER_FAILED":return`clean filter '${e.filter}' failed for ${t(e.path)} (exit ${e.exitCode})`;case"SMUDGE_FILTER_FAILED":return`smudge filter '${e.filter}' failed for ${t(e.path)} (exit ${e.exitCode})`;case"INVALID_FILTER_SPEC":return`invalid object filter "${e.spec}": ${e.reason}`;case"REMOTE_FILTER_UNSUPPORTED":return"remote does not support partial-clone object filtering";case"UNEXPECTED_V2_SECTION":return`unexpected v2 section: ${e.section}`;case"V2_COMMAND_UNSUPPORTED":return`unsupported v2 command or capability: ${e.command}`;case"TOO_MANY_SECTION_ENTRIES":return`v2 section "${e.section}" entries (${e.count}) exceed limit ${e.limit}`;case"UNSUPPORTED_OBJECT_FORMAT":return`unsupported object format: ${e.format}`;case"SNAPSHOT_REQUIRED":return`snapshot required: ${e.reason}`;case"WORKDIR_RACE":return`working-tree changed under us at ${t(e.path)} (observed mtime=${e.observed.mtimeMs} size=${e.observed.size}, current mtime=${e.current.mtimeMs} size=${e.current.size})`;case"ORDER_INVARIANT_VIOLATION":return`row order broken: ${e.previous} followed by ${e.current}`;case"CONFIG_KEY_INVALID":return void 0===e.position?`invalid config key "${e.key}": ${e.reason}`:`invalid config key "${e.key}": ${e.reason} at position ${e.position}`;case"CONFIG_VALUE_INVALID":return`invalid config value for "${e.key}": ${e.reason} at position ${e.position}`;case"CONFIG_PARSE_ERROR":return void 0===e.source?`bad config line ${e.line}`:`bad config line ${e.line} in file ${e.source}`;case"CONFIG_MISSING_VALUE":return`missing value for '${e.key}' in file '${e.source}' at line ${e.line}`;case"MERGE_DRIVER_MISSING_COMMAND":return`custom merge driver ${e.name} lacks command line.`;case"CONFIG_BAD_NUMERIC_VALUE":return`bad numeric config value '${e.value}' for '${e.key}' in file ${e.source}: ${e.reason}`;case"CONFIG_BAD_ZLIB_LEVEL":return`bad zlib compression level ${e.level}`;case"CONFIG_INVALID_FILE":return`invalid section name '${e.sectionName}' in config file ${e.source}`;case"CONFIG_MULTIPLE_VALUES":return void 0===e.scope?`config key "${e.key}" has ${e.count} values (${e.requested} requires single)`:`config key "${e.key}" has ${e.count} values in scope ${e.scope} (${e.requested} requires single)`;case"CONFIG_SECTION_NOT_FOUND":return`config section not found in scope ${e.scope}: ${e.name}`;case"CONFIG_SCOPE_NOT_AVAILABLE":return`config scope not available: ${e.scope} (${e.reason})`;case"CONFIG_SYSTEM_PATH_UNRESOLVED":return"config system path could not be resolved on this platform";case"MV_SOURCE_NOT_TRACKED":return`not under version control, source=${e.source}, destination=${e.destination}`;case"MV_BAD_SOURCE":return`bad source, source=${e.source}, destination=${e.destination}`;case"MV_DESTINATION_EXISTS":return`destination exists, source=${e.source}, destination=${e.destination}`;case"MV_INTO_SELF":return`can not move directory into itself, source=${e.source}, destination=${e.destination}`;case"MV_DESTINATION_NOT_DIRECTORY":return`destination '${e.destination}' is not a directory, source=${e.source}`;case"MV_DESTINATION_DIRECTORY_MISSING":return`destination directory does not exist, source=${e.source}, destination=${e.destination}`;case"MV_MULTIPLE_SOURCES_SAME_TARGET":return`multiple sources for the same target, source=${e.source}, destination=${e.destination}`;case"MV_OVERLAPPING_SOURCES":return`cannot move both '${e.child}' and its parent directory '${e.parent}'`;case"RM_STAGED_CHANGES":return`cannot remove ${e.paths.length} file(s) with changes staged in the index (use --cached to keep the file, or -f to force removal)`;case"RM_LOCAL_MODIFICATIONS":return`cannot remove ${e.paths.length} file(s) with local modifications (use --cached to keep the file, or -f to force removal)`;case"RM_STAGED_AND_LOCAL_CHANGES":return`cannot remove ${e.paths.length} file(s) with staged content different from both the file and HEAD (use -f to force removal)`;case"NO_INITIAL_COMMIT":return"you do not have the initial commit yet";case"STASH_NOT_FOUND":return`stash@{${e.index}} is not a valid stash reference (stack size ${e.stackSize})`;case"STASH_APPLY_WOULD_OVERWRITE":return`cannot apply stash: ${e.paths.length} local change(s) would be overwritten`;case"AMBIGUOUS_OID_PREFIX":return`short object id ${e.prefix} is ambiguous (${e.candidates.length} candidates)`;case"INVALID_SEQUENCER_TODO":return`invalid sequencer todo: ${e.reason}`;case"CHERRY_PICK_MERGE_NO_MAINLINE":case"REVERT_MERGE_NO_MAINLINE":return`commit ${e.commit} is a merge but no -m option was given`;case"NO_NAMES":return`no names found, cannot describe ${e.oid}`;case"NO_ANNOTATED_NAMES":return`no annotated tags can describe ${e.oid}; try tags: true`;case"NO_REACHABLE_NAMES":return`no tags can describe ${e.oid}`;case"NO_EXACT_MATCH":return`no tag exactly matches ${e.oid}`;case"CANNOT_DESCRIBE":return`cannot describe ${e.oid}`;case"RELATIVE_URL_UNRESOLVABLE":return`cannot strip one component off url '${e.url}'`;case"SUBMODULE_HAS_MODIFICATIONS":return`submodule work tree '${e.path}' contains local modifications`;case"SUBMODULE_PATH_EXISTS":return`'${e.path}' already exists in the index`;case"WORKTREE_PATH_EXISTS":return`'${e.path}' already exists`;case"BRANCH_CHECKED_OUT":return`'${e.branch}' is already used by worktree at '${e.path}'`;case"WORKTREE_LOCKED":return`working tree '${e.path}' is locked`;case"WORKTREE_DIRTY":return`'${e.path}' contains modified or untracked files, use --force to delete it`;case"NOT_A_WORKTREE":return`'${e.path}' is not a working tree`;case"BUNDLE_EMPTY":return`refusing to create empty bundle: ${e.reason}`;case"BUNDLE_READ_FAILED":return`could not open '${e.path}'`;case"BUNDLE_BAD_HEADER":return`'${e.path}' does not look like a v2 or v3 bundle file`;case"BUNDLE_UNSUPPORTED_VERSION":return void 0!==e.path?`unsupported bundle version ${e.version} in '${e.path}'`:`unsupported bundle version ${e.version} for serialization`;case"BUNDLE_PREREQUISITE_NOT_COMMIT":return`boundary object ${e.oid} is not a commit (got ${e.objectType})`;case"NOTES_ALREADY_EXIST":return`Cannot add notes. Found existing notes for object ${e.object}. Use '-f' to overwrite existing notes`;case"NOTES_OBJECT_HAS_NONE":return`Object ${e.object} has no note`;case"NOTES_REF_OUTSIDE":return`refusing to use notes ref ${e.ref} (outside of refs/notes/)`;case"SIGNING_FAILED":return`gpg failed to sign the data (${e.reason}${void 0!==e.format?`, format=${e.format}`:""})`;case"SIGNED_PUSH_UNSUPPORTED":return"the receiving end does not support --signed push";case"PUSH_DETACHED_NO_REFSPEC":return"you are not currently on a branch";case"PUSH_DEFAULT_NOTHING":return'you didn\'t specify any refspecs to push, and push.default is "nothing"';case"PUSH_REMOTE_NOT_UPSTREAM":return`you are pushing to remote '${e.remote}', which is not the upstream of your current branch '${e.branch}'`;case"PUSH_UPSTREAM_NAME_MISMATCH":return"the upstream branch of your current branch does not match the name of your current branch";case"INVALID_PUSH_DEFAULT":return`bad config variable 'push.default' in file '${e.source}' at line ${e.line}`;default:return String(e)}}(e)}`),this.data=e}}function t(e){const t=e.split(/[/\\]/);for(let e=t.length-1;e>=0;e--){const r=t[e];if(void 0!==r&&""!==r)return r}return e}const r=e=>{let t="";for(let r=0;r<e.length;r+=1){const o=e.charCodeAt(r);t+=9===o||10===o||o>=32&&o<=126?e[r]:`\\x${o.toString(16).toUpperCase().padStart(2,"0")}`}return t},o=r;exports.TsgitError=e,exports.adapterUnavailable=(t,o)=>new e({code:"ADAPTER_UNAVAILABLE",runtime:t,reason:r(o)}),exports.ambiguousOidPrefix=(t,r)=>new e({code:"AMBIGUOUS_OID_PREFIX",prefix:t,candidates:r}),exports.authorUnconfigured=()=>new e({code:"AUTHOR_UNCONFIGURED"}),exports.basename=t,exports.blockedHost=(t,o)=>new e({code:"BLOCKED_HOST",host:r(t),reason:r(o)}),exports.branchExists=t=>new e({code:"BRANCH_EXISTS",name:t}),exports.branchNotFound=t=>new e({code:"BRANCH_NOT_FOUND",name:t}),exports.bundleBadHeader=(t,o)=>new e({code:"BUNDLE_BAD_HEADER",path:r(t),reason:o}),exports.bundleEmpty=t=>new e({code:"BUNDLE_EMPTY",reason:t}),exports.bundlePrerequisiteNotCommit=(t,r)=>new e({code:"BUNDLE_PREREQUISITE_NOT_COMMIT",oid:t,objectType:r}),exports.bundleReadFailed=t=>new e({code:"BUNDLE_READ_FAILED",path:r(t)}),exports.bundleUnsupportedVersion=(t,o)=>new e({code:"BUNDLE_UNSUPPORTED_VERSION",path:r(t),version:o}),exports.cannotDeleteCheckedOutBranch=t=>new e({code:"CANNOT_DELETE_CHECKED_OUT_BRANCH",name:t}),exports.cannotDescribe=t=>new e({code:"CANNOT_DESCRIBE",oid:t}),exports.checkoutOverwriteDirty=({localChanges:t,untracked:r})=>new e({code:"CHECKOUT_OVERWRITE_DIRTY",localChanges:t,untracked:r}),exports.cherryPickMergeNoMainline=t=>new e({code:"CHERRY_PICK_MERGE_NO_MAINLINE",commit:t}),exports.cleanFilterFailed=(t,r,o)=>new e({code:"CLEAN_FILTER_FAILED",path:t,filter:r,exitCode:o}),exports.compressFailed=t=>new e({code:"COMPRESS_FAILED",reason:t}),exports.configBadNumericValue=(t,o,n,s)=>new e({code:"CONFIG_BAD_NUMERIC_VALUE",key:t,source:o,value:r(n),reason:s}),exports.configBadZlibLevel=t=>new e({code:"CONFIG_BAD_ZLIB_LEVEL",level:t}),exports.configInvalidFile=(t,r)=>new e({code:"CONFIG_INVALID_FILE",sectionName:t,source:r}),exports.configKeyInvalid=(t,o,n)=>new e(void 0===n?{code:"CONFIG_KEY_INVALID",key:r(t),reason:o}:{code:"CONFIG_KEY_INVALID",key:r(t),reason:o,position:n}),exports.configMissingValue=(t,r,o)=>new e({code:"CONFIG_MISSING_VALUE",key:t,source:r,line:o}),exports.configMultipleValues=(t,o,n,s)=>new e(void 0===s?{code:"CONFIG_MULTIPLE_VALUES",key:r(t),count:o,requested:n}:{code:"CONFIG_MULTIPLE_VALUES",key:r(t),count:o,requested:n,scope:s}),exports.configParseError=(t,r,o)=>new e({code:"CONFIG_PARSE_ERROR",line:t,...void 0!==r?{source:r}:{},...void 0!==o?{partialSectionName:o}:{}}),exports.configScopeNotAvailable=(t,r)=>new e({code:"CONFIG_SCOPE_NOT_AVAILABLE",scope:t,reason:r}),exports.configSectionNotFound=(t,o)=>new e({code:"CONFIG_SECTION_NOT_FOUND",name:r(t),scope:o}),exports.configSystemPathUnresolved=()=>new e({code:"CONFIG_SYSTEM_PATH_UNRESOLVED"}),exports.configValueInvalid=(t,o)=>new e({code:"CONFIG_VALUE_INVALID",key:r(t),reason:"control-character",position:o}),exports.decompressFailed=t=>new e({code:"DECOMPRESS_FAILED",reason:t}),exports.directoryNotEmpty=t=>new e({code:"DIRECTORY_NOT_EMPTY",path:t}),exports.dirname=function(e){const t=e.lastIndexOf("/");return-1===t?"":e.slice(0,t)},exports.emptyCommitMessage=()=>new e({code:"EMPTY_COMMIT_MESSAGE"}),exports.emptyPathspec=()=>new e({code:"EMPTY_PATHSPEC"}),exports.fileExists=t=>new e({code:"FILE_EXISTS",path:t}),exports.fileNotFound=t=>new e({code:"FILE_NOT_FOUND",path:t}),exports.gitattributesFileTooLarge=(t,r,o)=>new e({code:"GITATTRIBUTES_FILE_TOO_LARGE",path:t,size:r,limit:o}),exports.gitignoreFileTooLarge=(t,r,o)=>new e({code:"GITIGNORE_FILE_TOO_LARGE",path:t,size:r,limit:o}),exports.hashFailed=t=>new e({code:"HASH_FAILED",reason:t}),exports.hookFailed=(t,o,n)=>new e({code:"HOOK_FAILED",hook:t,exitCode:o,stderr:r(n).slice(0,4096)}),exports.httpError=(t,r)=>new e({code:"HTTP_ERROR",statusCode:t,reason:r}),exports.invalidOption=(t,o)=>new e({code:"INVALID_OPTION",option:t,reason:r(o)}),exports.invalidPushDefault=(t,r,o)=>new e({code:"INVALID_PUSH_DEFAULT",value:t,source:r,line:o}),exports.invalidSequencerTodo=t=>new e({code:"INVALID_SEQUENCER_TODO",reason:r(t)}),exports.invalidUrl=t=>new e({code:"INVALID_URL",reason:t}),exports.invalidWalkInput=t=>new e({code:"INVALID_WALK_INPUT",reason:t}),exports.mergeDriverMissingCommand=t=>new e({code:"MERGE_DRIVER_MISSING_COMMAND",name:t}),exports.mergeHasConflicts=(t,r=[])=>{const o=r.length>100,n=o?r.slice(0,100):r;return new e(o?{code:"MERGE_HAS_CONFLICTS",count:t,paths:n,truncated:!0}:{code:"MERGE_HAS_CONFLICTS",count:t,paths:n})},exports.mvBadSource=(t,r)=>new e({code:"MV_BAD_SOURCE",source:t,destination:r}),exports.mvDestinationDirectoryMissing=(t,r)=>new e({code:"MV_DESTINATION_DIRECTORY_MISSING",source:t,destination:r}),exports.mvDestinationExists=(t,r)=>new e({code:"MV_DESTINATION_EXISTS",source:t,destination:r}),exports.mvDestinationNotDirectory=(t,r)=>new e({code:"MV_DESTINATION_NOT_DIRECTORY",source:t,destination:r}),exports.mvIntoSelf=(t,r)=>new e({code:"MV_INTO_SELF",source:t,destination:r}),exports.mvMultipleSourcesSameTarget=(t,r)=>new e({code:"MV_MULTIPLE_SOURCES_SAME_TARGET",source:t,destination:r}),exports.mvOverlappingSources=(t,r)=>new e({code:"MV_OVERLAPPING_SOURCES",child:t,parent:r}),exports.mvSourceNotTracked=(t,r)=>new e({code:"MV_SOURCE_NOT_TRACKED",source:t,destination:r}),exports.networkError=t=>new e({code:"NETWORK_ERROR",reason:t}),exports.noAnnotatedNames=t=>new e({code:"NO_ANNOTATED_NAMES",oid:t}),exports.noExactMatch=t=>new e({code:"NO_EXACT_MATCH",oid:t}),exports.noInitialCommit=()=>new e({code:"NO_INITIAL_COMMIT"}),exports.noNames=t=>new e({code:"NO_NAMES",oid:t}),exports.noOperationInProgress=t=>new e({code:"NO_OPERATION_IN_PROGRESS",operation:t}),exports.noPromisorRemote=()=>new e({code:"NO_PROMISOR_REMOTE"}),exports.noReachableNames=t=>new e({code:"NO_REACHABLE_NAMES",oid:t}),exports.noUpstreamConfigured=t=>new e({code:"NO_UPSTREAM_CONFIGURED",branch:t}),exports.nonFastForward=(t,r,o)=>new e({code:"NON_FAST_FORWARD",ref:t,local:r,remote:o}),exports.notADirectory=t=>new e({code:"NOT_A_DIRECTORY",path:t}),exports.notesAlreadyExist=t=>new e({code:"NOTES_ALREADY_EXIST",object:t}),exports.notesObjectHasNone=t=>new e({code:"NOTES_OBJECT_HAS_NONE",object:t}),exports.notesRefOutside=t=>new e({code:"NOTES_REF_OUTSIDE",ref:t}),exports.nothingToCommit=()=>new e({code:"NOTHING_TO_COMMIT"}),exports.operationAborted=()=>new e({code:"OPERATION_ABORTED"}),exports.operationInProgress=t=>new e({code:"OPERATION_IN_PROGRESS",operation:t}),exports.orderInvariantViolation=(t,r)=>new e({code:"ORDER_INVARIANT_VIOLATION",previous:t,current:r}),exports.pathNotInTree=(t,o)=>new e({code:"PATH_NOT_IN_TREE",rev:r(t),path:r(o)}),exports.pathspecNoMatch=t=>new e({code:"PATHSPEC_NO_MATCH",pattern:t}),exports.pathspecOutsideRepo=t=>new e({code:"PATHSPEC_OUTSIDE_REPO",path:t}),exports.permissionDenied=t=>new e({code:"PERMISSION_DENIED",path:t}),exports.pushDefaultNothing=()=>new e({code:"PUSH_DEFAULT_NOTHING"}),exports.pushDetachedNoRefspec=()=>new e({code:"PUSH_DETACHED_NO_REFSPEC"}),exports.pushRejected=(t,r,o)=>new e({code:"PUSH_REJECTED",ref:t,reason:r,reportStatus:o}),exports.pushRemoteNotUpstream=(t,r)=>new e({code:"PUSH_REMOTE_NOT_UPSTREAM",remote:t,branch:r}),exports.pushUpstreamNameMismatch=(t,r)=>new e({code:"PUSH_UPSTREAM_NAME_MISMATCH",branch:t,upstream:r}),exports.remoteAdvertisesNoRefs=()=>new e({code:"REMOTE_ADVERTISES_NO_REFS"}),exports.remoteExists=t=>new e({code:"REMOTE_EXISTS",remote:t}),exports.remoteNameInvalid=(t,o)=>new e({code:"REMOTE_NAME_INVALID",name:r(t),reason:r(o)}),exports.remoteNotConfigured=t=>new e({code:"REMOTE_NOT_CONFIGURED",remote:t}),exports.repositoryDisposed=()=>new e({code:"REPOSITORY_DISPOSED"}),exports.revertMergeNoMainline=t=>new e({code:"REVERT_MERGE_NO_MAINLINE",commit:t}),exports.revparseUnresolved=t=>new e({code:"REVPARSE_UNRESOLVED",expression:t}),exports.rmLocalModifications=t=>new e({code:"RM_LOCAL_MODIFICATIONS",paths:t}),exports.rmStagedAndLocalChanges=t=>new e({code:"RM_STAGED_AND_LOCAL_CHANGES",paths:t}),exports.rmStagedChanges=t=>new e({code:"RM_STAGED_CHANGES",paths:t}),exports.sanitize=o,exports.signedPushUnsupported=t=>new e({code:"SIGNED_PUSH_UNSUPPORTED",remote:t}),exports.signingFailed=(t,r)=>new e(void 0===r?{code:"SIGNING_FAILED",reason:t}:{code:"SIGNING_FAILED",reason:t,format:r}),exports.smudgeFilterFailed=(t,r,o)=>new e({code:"SMUDGE_FILTER_FAILED",path:t,filter:r,exitCode:o}),exports.snapshotRequired=t=>new e({code:"SNAPSHOT_REQUIRED",reason:t}),exports.sparsePatternFileTooLarge=(t,r,o)=>new e({code:"SPARSE_PATTERN_FILE_TOO_LARGE",path:t,size:r,limit:o}),exports.stashApplyWouldOverwrite=t=>new e({code:"STASH_APPLY_WOULD_OVERWRITE",paths:t}),exports.stashNotFound=(t,r)=>new e({code:"STASH_NOT_FOUND",index:t,stackSize:r}),exports.tagExists=t=>new e({code:"TAG_EXISTS",name:t}),exports.tagNotFound=t=>new e({code:"TAG_NOT_FOUND",name:t}),exports.targetDirectoryNotEmpty=t=>new e({code:"TARGET_DIRECTORY_NOT_EMPTY",path:t}),exports.unsupportedOperation=(t,r)=>new e({code:"UNSUPPORTED_OPERATION",operation:t,reason:r}),exports.unsupportedScheme=t=>new e({code:"UNSUPPORTED_SCHEME",scheme:t}),exports.workdirRace=(t,r,o)=>new e({code:"WORKDIR_RACE",path:t,observed:r,current:o}),exports.workingTreeDirty=({localChanges:t,untracked:r})=>new e({code:"WORKING_TREE_DIRTY",localChanges:t,untracked:r}),exports.workingTreeFileTooLarge=(t,r,o)=>new e({code:"WORKING_TREE_FILE_TOO_LARGE",path:t,size:r,limit:o}),exports.worktreeFileAbsent=t=>new e({code:"WORKTREE_FILE_ABSENT",path:r(t)});