viba-cli 0.38.0 → 0.40.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 (230) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/build-manifest.json +2 -2
  3. package/.next/fallback-build-manifest.json +2 -2
  4. package/.next/prerender-manifest.json +3 -3
  5. package/.next/server/app/_global-error.html +2 -2
  6. package/.next/server/app/_global-error.rsc +1 -1
  7. package/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  8. package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  9. package/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  10. package/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  11. package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  12. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  13. package/.next/server/app/_not-found.html +2 -2
  14. package/.next/server/app/_not-found.rsc +3 -3
  15. package/.next/server/app/_not-found.segments/_full.segment.rsc +3 -3
  16. package/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  17. package/.next/server/app/_not-found.segments/_index.segment.rsc +3 -3
  18. package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  19. package/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  20. package/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  21. package/.next/server/app/api/custom-scripts/route.js +2 -2
  22. package/.next/server/app/api/custom-scripts/route.js.nft.json +1 -1
  23. package/.next/server/app/api/git/action/route.js +3 -3
  24. package/.next/server/app/api/git/action/route.js.nft.json +1 -1
  25. package/.next/server/app/api/git/branches/route.js +3 -3
  26. package/.next/server/app/api/git/branches/route.js.nft.json +1 -1
  27. package/.next/server/app/api/git/diff/route.js +2 -2
  28. package/.next/server/app/api/git/diff/route.js.nft.json +1 -1
  29. package/.next/server/app/api/git/log/route.js +2 -2
  30. package/.next/server/app/api/git/log/route.js.nft.json +1 -1
  31. package/.next/server/app/api/git/status/route.js +3 -3
  32. package/.next/server/app/api/git/status/route.js.nft.json +1 -1
  33. package/.next/server/app/api/repos/clone/route.js +2 -2
  34. package/.next/server/app/api/repos/clone/route.js.nft.json +1 -1
  35. package/.next/server/app/api/repos/route.js +2 -2
  36. package/.next/server/app/api/repos/route.js.nft.json +1 -1
  37. package/.next/server/app/api/settings/route.js.nft.json +1 -1
  38. package/.next/server/app/credentials/page/server-reference-manifest.json +7 -7
  39. package/.next/server/app/credentials/page.js.nft.json +1 -1
  40. package/.next/server/app/credentials/page_client-reference-manifest.js +1 -1
  41. package/.next/server/app/credentials.html +2 -2
  42. package/.next/server/app/credentials.rsc +5 -5
  43. package/.next/server/app/credentials.segments/_full.segment.rsc +5 -5
  44. package/.next/server/app/credentials.segments/_head.segment.rsc +1 -1
  45. package/.next/server/app/credentials.segments/_index.segment.rsc +3 -3
  46. package/.next/server/app/credentials.segments/_tree.segment.rsc +2 -2
  47. package/.next/server/app/credentials.segments/credentials/__PAGE__.segment.rsc +2 -2
  48. package/.next/server/app/credentials.segments/credentials.segment.rsc +1 -1
  49. package/.next/server/app/git/changes/page.js.nft.json +1 -1
  50. package/.next/server/app/git/changes/page_client-reference-manifest.js +1 -1
  51. package/.next/server/app/git/changes.html +2 -2
  52. package/.next/server/app/git/changes.rsc +8 -8
  53. package/.next/server/app/git/changes.segments/_full.segment.rsc +8 -8
  54. package/.next/server/app/git/changes.segments/_head.segment.rsc +1 -1
  55. package/.next/server/app/git/changes.segments/_index.segment.rsc +3 -3
  56. package/.next/server/app/git/changes.segments/_tree.segment.rsc +2 -2
  57. package/.next/server/app/git/changes.segments/git/changes/__PAGE__.segment.rsc +2 -2
  58. package/.next/server/app/git/changes.segments/git/changes.segment.rsc +1 -1
  59. package/.next/server/app/git/changes.segments/git.segment.rsc +3 -3
  60. package/.next/server/app/git/custom-scripts/page.js.nft.json +1 -1
  61. package/.next/server/app/git/custom-scripts/page_client-reference-manifest.js +1 -1
  62. package/.next/server/app/git/custom-scripts.html +2 -2
  63. package/.next/server/app/git/custom-scripts.rsc +7 -7
  64. package/.next/server/app/git/custom-scripts.segments/_full.segment.rsc +7 -7
  65. package/.next/server/app/git/custom-scripts.segments/_head.segment.rsc +1 -1
  66. package/.next/server/app/git/custom-scripts.segments/_index.segment.rsc +3 -3
  67. package/.next/server/app/git/custom-scripts.segments/_tree.segment.rsc +2 -2
  68. package/.next/server/app/git/custom-scripts.segments/git/custom-scripts/__PAGE__.segment.rsc +2 -2
  69. package/.next/server/app/git/custom-scripts.segments/git/custom-scripts.segment.rsc +1 -1
  70. package/.next/server/app/git/custom-scripts.segments/git.segment.rsc +3 -3
  71. package/.next/server/app/git/history/page.js.nft.json +1 -1
  72. package/.next/server/app/git/history/page_client-reference-manifest.js +1 -1
  73. package/.next/server/app/git/history.html +2 -2
  74. package/.next/server/app/git/history.rsc +8 -8
  75. package/.next/server/app/git/history.segments/_full.segment.rsc +8 -8
  76. package/.next/server/app/git/history.segments/_head.segment.rsc +1 -1
  77. package/.next/server/app/git/history.segments/_index.segment.rsc +3 -3
  78. package/.next/server/app/git/history.segments/_tree.segment.rsc +2 -2
  79. package/.next/server/app/git/history.segments/git/history/__PAGE__.segment.rsc +2 -2
  80. package/.next/server/app/git/history.segments/git/history.segment.rsc +1 -1
  81. package/.next/server/app/git/history.segments/git.segment.rsc +3 -3
  82. package/.next/server/app/git/page.js.nft.json +1 -1
  83. package/.next/server/app/git/page_client-reference-manifest.js +1 -1
  84. package/.next/server/app/git/stashes/page.js.nft.json +1 -1
  85. package/.next/server/app/git/stashes/page_client-reference-manifest.js +1 -1
  86. package/.next/server/app/git/stashes.html +2 -2
  87. package/.next/server/app/git/stashes.rsc +7 -7
  88. package/.next/server/app/git/stashes.segments/_full.segment.rsc +7 -7
  89. package/.next/server/app/git/stashes.segments/_head.segment.rsc +1 -1
  90. package/.next/server/app/git/stashes.segments/_index.segment.rsc +3 -3
  91. package/.next/server/app/git/stashes.segments/_tree.segment.rsc +2 -2
  92. package/.next/server/app/git/stashes.segments/git/stashes/__PAGE__.segment.rsc +2 -2
  93. package/.next/server/app/git/stashes.segments/git/stashes.segment.rsc +1 -1
  94. package/.next/server/app/git/stashes.segments/git.segment.rsc +3 -3
  95. package/.next/server/app/git.html +2 -2
  96. package/.next/server/app/git.rsc +8 -8
  97. package/.next/server/app/git.segments/_full.segment.rsc +8 -8
  98. package/.next/server/app/git.segments/_head.segment.rsc +1 -1
  99. package/.next/server/app/git.segments/_index.segment.rsc +3 -3
  100. package/.next/server/app/git.segments/_tree.segment.rsc +2 -2
  101. package/.next/server/app/git.segments/git/__PAGE__.segment.rsc +2 -2
  102. package/.next/server/app/git.segments/git.segment.rsc +3 -3
  103. package/.next/server/app/index.html +2 -2
  104. package/.next/server/app/index.rsc +5 -5
  105. package/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
  106. package/.next/server/app/index.segments/_full.segment.rsc +5 -5
  107. package/.next/server/app/index.segments/_head.segment.rsc +1 -1
  108. package/.next/server/app/index.segments/_index.segment.rsc +3 -3
  109. package/.next/server/app/index.segments/_tree.segment.rsc +2 -2
  110. package/.next/server/app/new/page/server-reference-manifest.json +29 -29
  111. package/.next/server/app/new/page.js +2 -2
  112. package/.next/server/app/new/page.js.nft.json +1 -1
  113. package/.next/server/app/new/page_client-reference-manifest.js +1 -1
  114. package/.next/server/app/page/server-reference-manifest.json +29 -29
  115. package/.next/server/app/page.js +1 -1
  116. package/.next/server/app/page.js.nft.json +1 -1
  117. package/.next/server/app/page_client-reference-manifest.js +1 -1
  118. package/.next/server/app/session/[sessionId]/page/server-reference-manifest.json +19 -19
  119. package/.next/server/app/session/[sessionId]/page.js +1 -1
  120. package/.next/server/app/session/[sessionId]/page.js.nft.json +1 -1
  121. package/.next/server/app/session/[sessionId]/page_client-reference-manifest.js +1 -1
  122. package/.next/server/chunks/[root-of-the-server]__01a6baa7._.js +1 -1
  123. package/.next/server/chunks/[root-of-the-server]__01a6baa7._.js.map +1 -1
  124. package/.next/server/chunks/[root-of-the-server]__2ea0148f._.js +7 -0
  125. package/.next/server/chunks/[root-of-the-server]__2ea0148f._.js.map +1 -0
  126. package/.next/server/chunks/[root-of-the-server]__51f9ab28._.js +3 -0
  127. package/.next/server/chunks/{[root-of-the-server]__7f2f8f49._.js.map → [root-of-the-server]__51f9ab28._.js.map} +1 -1
  128. package/.next/server/chunks/[root-of-the-server]__52f9b7e2._.js +3 -0
  129. package/.next/server/chunks/{[root-of-the-server]__afea2116._.js.map → [root-of-the-server]__52f9b7e2._.js.map} +1 -1
  130. package/.next/server/chunks/[root-of-the-server]__5b08b37e._.js +3 -0
  131. package/.next/server/chunks/{[root-of-the-server]__7324fe0b._.js.map → [root-of-the-server]__5b08b37e._.js.map} +1 -1
  132. package/.next/server/chunks/[root-of-the-server]__8b29248a._.js +3 -0
  133. package/.next/server/chunks/{[root-of-the-server]__82d53572._.js.map → [root-of-the-server]__8b29248a._.js.map} +1 -1
  134. package/.next/server/chunks/[root-of-the-server]__f52f1c06._.js +3 -0
  135. package/.next/server/chunks/{[root-of-the-server]__5349b858._.js.map → [root-of-the-server]__f52f1c06._.js.map} +1 -1
  136. package/.next/server/chunks/node_modules_next_dist_esm_build_templates_app-route_0002606b.js +1 -1
  137. package/.next/server/chunks/node_modules_next_dist_esm_build_templates_app-route_0002606b.js.map +1 -1
  138. package/.next/server/chunks/ssr/[root-of-the-server]__05e6fb4c._.js +1 -1
  139. package/.next/server/chunks/ssr/{[root-of-the-server]__79a7a15d._.js → [root-of-the-server]__0ed2deb1._.js} +2 -2
  140. package/.next/server/chunks/ssr/{[root-of-the-server]__79a7a15d._.js.map → [root-of-the-server]__0ed2deb1._.js.map} +1 -1
  141. package/.next/server/chunks/ssr/{[root-of-the-server]__2798aa4d._.js → [root-of-the-server]__1ed5a76d._.js} +3 -3
  142. package/.next/server/chunks/ssr/{[root-of-the-server]__2798aa4d._.js.map → [root-of-the-server]__1ed5a76d._.js.map} +1 -1
  143. package/.next/server/chunks/ssr/[root-of-the-server]__46af1502._.js +1 -1
  144. package/.next/server/chunks/ssr/[root-of-the-server]__46af1502._.js.map +1 -1
  145. package/.next/server/chunks/ssr/{[root-of-the-server]__05b3451a._.js → [root-of-the-server]__a65a3900._.js} +2 -2
  146. package/.next/server/chunks/ssr/{[root-of-the-server]__05b3451a._.js.map → [root-of-the-server]__a65a3900._.js.map} +1 -1
  147. package/.next/server/chunks/ssr/[root-of-the-server]__d52659cf._.js +3 -0
  148. package/.next/server/chunks/ssr/[root-of-the-server]__d52659cf._.js.map +1 -0
  149. package/.next/server/chunks/ssr/{_523ff032._.js → _2eaa7035._.js} +2 -2
  150. package/.next/server/chunks/ssr/{_523ff032._.js.map → _2eaa7035._.js.map} +1 -1
  151. package/.next/server/chunks/ssr/{_be721a9c._.js → _4343fa01._.js} +2 -2
  152. package/.next/server/chunks/ssr/{_be721a9c._.js.map → _4343fa01._.js.map} +1 -1
  153. package/.next/server/chunks/ssr/_476e86d1._.js +1 -1
  154. package/.next/server/chunks/ssr/_4d07d45e._.js +1 -1
  155. package/.next/server/chunks/ssr/_4d07d45e._.js.map +1 -1
  156. package/.next/server/chunks/ssr/_57f63a65._.js +1 -1
  157. package/.next/server/chunks/ssr/_57f63a65._.js.map +1 -1
  158. package/.next/server/chunks/ssr/_707e5fab._.js +1 -1
  159. package/.next/server/chunks/ssr/_9493de08._.js +1 -1
  160. package/.next/server/chunks/ssr/{_787bdec7._.js → _a07f93fb._.js} +2 -2
  161. package/.next/server/chunks/ssr/{_787bdec7._.js.map → _a07f93fb._.js.map} +1 -1
  162. package/.next/server/chunks/ssr/{_2a7fa4b0._.js → _ebf4c61c._.js} +2 -2
  163. package/.next/server/chunks/ssr/{_2a7fa4b0._.js.map → _ebf4c61c._.js.map} +1 -1
  164. package/.next/server/chunks/ssr/_ff20dbae._.js +3 -0
  165. package/.next/server/chunks/ssr/{_e17414c3._.js.map → _ff20dbae._.js.map} +1 -1
  166. package/.next/server/chunks/ssr/src_app_credentials_page_tsx_63d8d34a._.js +1 -1
  167. package/.next/server/chunks/ssr/src_app_credentials_page_tsx_63d8d34a._.js.map +1 -1
  168. package/.next/server/chunks/ssr/src_app_git_changes_page_tsx_f6dc28dc._.js +2 -2
  169. package/.next/server/chunks/ssr/src_app_git_changes_page_tsx_f6dc28dc._.js.map +1 -1
  170. package/.next/server/chunks/ssr/src_app_providers_tsx_2ae5be81._.js +1 -1
  171. package/.next/server/chunks/ssr/src_app_providers_tsx_2ae5be81._.js.map +1 -1
  172. package/.next/server/chunks/ssr/src_app_session_[sessionId]_SessionPageClient_tsx_dab490d7._.js +1 -1
  173. package/.next/server/chunks/ssr/src_app_session_[sessionId]_SessionPageClient_tsx_dab490d7._.js.map +1 -1
  174. package/.next/server/chunks/ssr/src_components_GitRepoSelector_tsx_05c81afa._.js +3 -3
  175. package/.next/server/chunks/ssr/src_components_GitRepoSelector_tsx_05c81afa._.js.map +1 -1
  176. package/.next/server/chunks/ssr/src_components_git_029e6e6f._.js +3 -0
  177. package/.next/server/chunks/ssr/src_components_git_029e6e6f._.js.map +1 -0
  178. package/.next/server/chunks/ssr/src_components_git_history-view_tsx_fd62126a._.js +4 -4
  179. package/.next/server/chunks/ssr/src_components_git_history-view_tsx_fd62126a._.js.map +1 -1
  180. package/.next/server/chunks/ssr/src_db5b513b._.js +3 -0
  181. package/.next/server/chunks/ssr/src_db5b513b._.js.map +1 -0
  182. package/.next/server/pages/404.html +2 -2
  183. package/.next/server/pages/500.html +2 -2
  184. package/.next/server/server-reference-manifest.js +1 -1
  185. package/.next/server/server-reference-manifest.json +48 -48
  186. package/.next/static/chunks/{ff0443d5f56a7060.js → 1ca050861ead915f.js} +1 -1
  187. package/.next/static/chunks/1f428267926cd032.js +3 -0
  188. package/.next/static/chunks/4aab1f3ea2ed1aef.js +1 -0
  189. package/.next/static/chunks/4de7bc5a00a1aed9.js +3 -0
  190. package/.next/static/chunks/5e0dada5236f9065.js +8 -0
  191. package/.next/static/chunks/{58e245f27f38e5ff.js → 73c13373731456db.js} +1 -1
  192. package/.next/static/chunks/73f859ef915277c7.js +3 -0
  193. package/.next/static/chunks/74f887e69c1fcefa.js +9 -0
  194. package/.next/static/chunks/977137e155012c13.js +1 -0
  195. package/.next/static/chunks/b18cc1247b979318.js +1 -0
  196. package/.next/static/chunks/d85a06040ea88b62.js +1 -0
  197. package/.next/static/chunks/{bcc203fd591a3e1b.js → db4cb4eb290e3be9.js} +1 -1
  198. package/.next/static/chunks/e5bcfa7f94c34b77.js +1 -0
  199. package/.next/static/chunks/eec24a7b35c2d7bd.css +1 -0
  200. package/.next/static/chunks/{46c9f58659e11b7d.js → fa9e48c3aa7e4365.js} +1 -1
  201. package/README.md +3 -0
  202. package/bin/viba.mjs +120 -4
  203. package/package.json +1 -1
  204. package/.next/server/chunks/[root-of-the-server]__2dcb1454._.js +0 -3
  205. package/.next/server/chunks/[root-of-the-server]__2dcb1454._.js.map +0 -1
  206. package/.next/server/chunks/[root-of-the-server]__5349b858._.js +0 -3
  207. package/.next/server/chunks/[root-of-the-server]__7324fe0b._.js +0 -3
  208. package/.next/server/chunks/[root-of-the-server]__7f2f8f49._.js +0 -3
  209. package/.next/server/chunks/[root-of-the-server]__82d53572._.js +0 -3
  210. package/.next/server/chunks/[root-of-the-server]__afea2116._.js +0 -3
  211. package/.next/server/chunks/[root-of-the-server]__b17e6c62._.js +0 -7
  212. package/.next/server/chunks/[root-of-the-server]__b17e6c62._.js.map +0 -1
  213. package/.next/server/chunks/ssr/[root-of-the-server]__30652385._.js +0 -3
  214. package/.next/server/chunks/ssr/[root-of-the-server]__30652385._.js.map +0 -1
  215. package/.next/server/chunks/ssr/_e17414c3._.js +0 -3
  216. package/.next/server/chunks/ssr/src_hooks_use-workspace-title_ts_9edd343b._.js +0 -3
  217. package/.next/server/chunks/ssr/src_hooks_use-workspace-title_ts_9edd343b._.js.map +0 -1
  218. package/.next/static/chunks/0eca2eff234acf1b.js +0 -1
  219. package/.next/static/chunks/47ad182e478611c4.css +0 -1
  220. package/.next/static/chunks/4b818f2593bc4300.js +0 -1
  221. package/.next/static/chunks/4d93976ea0e8b685.js +0 -9
  222. package/.next/static/chunks/78859d33c5671d29.js +0 -8
  223. package/.next/static/chunks/94fb2462104985a8.js +0 -3
  224. package/.next/static/chunks/9f82d45ee88d5dc1.js +0 -3
  225. package/.next/static/chunks/a29874cab09f6b0f.js +0 -3
  226. package/.next/static/chunks/e152c322e888ccea.js +0 -1
  227. package/.next/static/chunks/fff7986d66d302cf.js +0 -1
  228. /package/.next/static/{mx8z_YoNSm8FluLvondrw → SPowgKQ4GVFmr1hEouu16}/_buildManifest.js +0 -0
  229. /package/.next/static/{mx8z_YoNSm8FluLvondrw → SPowgKQ4GVFmr1hEouu16}/_clientMiddlewareManifest.json +0 -0
  230. /package/.next/static/{mx8z_YoNSm8FluLvondrw → SPowgKQ4GVFmr1hEouu16}/_ssgManifest.js +0 -0
@@ -1,7 +0,0 @@
1
- module.exports=[58533,(t,e,r)=>{"use strict";var s=t.e&&t.e.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(r,"__esModule",{value:!0});let i=t.r(22734),a=s(t.r(17293)).default("@kwsites/file-exists");r.exists=function(t,e=r.READABLE){return function(t,e,r){a("checking %s",t);try{let s=i.statSync(t);if(s.isFile()&&e)return a("[OK] path represents a file"),!0;if(s.isDirectory()&&r)return a("[OK] path represents a directory"),!0;return a("[FAIL] path represents something other than a file or directory"),!1}catch(t){if("ENOENT"===t.code)return a("[FAIL] path is not accessible: %o",t),!1;throw a("[FATAL] %o",t),t}}(t,(e&r.FILE)>0,(e&r.FOLDER)>0)},r.FILE=1,r.FOLDER=2,r.READABLE=r.FILE+r.FOLDER},67944,(t,e,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var s=t.r(58533);for(var i in s)r.hasOwnProperty(i)||(r[i]=s[i])},1473,(t,e,r)=>{"use strict";function s(){let t,e,r="pending";return{promise:new Promise((r,s)=>{t=r,e=s}),done(e){"pending"===r&&(r="resolved",t(e))},fail(t){"pending"===r&&(r="rejected",e(t))},get fulfilled(){return"pending"!==r},get status(){return r}}}Object.defineProperty(r,"__esModule",{value:!0}),r.createDeferred=r.deferred=void 0,r.deferred=s,r.createDeferred=s,r.default=s},12057,(t,e,r)=>{e.exports=t.x("node:util",()=>require("node:util"))},12714,(t,e,r)=>{e.exports=t.x("node:fs/promises",()=>require("node:fs/promises"))},60526,(t,e,r)=>{e.exports=t.x("node:os",()=>require("node:os"))},87140,t=>{"use strict";let e,r;var s,i,a,n,o,c,u,l,h,f,p,m,d,g,w,y,b,k,v,T,R,_,$,E,S,x,C,O,A,F,L,D,P,M,B,j,N,I,U,q,H,G,W,z,K,Q,V,X,Y,J,Z,tt,te,tr,ts,ti,ta,tn,to,tc,tu,tl,th,tf,tp,tm,td,tg,tw,ty,tb,tk,tv,tT,tR,t_,t$,tE,tS,tx,tC,tO,tA,tF,tL,tD,tP,tM,tB,tj,tN,tI,tU,tq,tH,tG,tW,tz,tK,tQ,tV=t.i(51615),tX=t.i(67944),tY=t.i(17293),tJ=t.i(33405),tZ=t.i(1473),t0=t.i(50227),t1=t.i(87769),t8=Object.defineProperty,t2=Object.getOwnPropertyDescriptor,t3=Object.getOwnPropertyNames,t9=Object.prototype.hasOwnProperty,t4=(t,e)=>function(){return t&&(e=(0,t[t3(t)[0]])(t=0)),e},t7=(t,e)=>{for(var r in e)t8(t,r,{get:e[r],enumerable:!0})},t5=t=>((t,e,r,s)=>{if(e&&"object"==typeof e||"function"==typeof e)for(let i of t3(e))t9.call(t,i)||i===r||t8(t,i,{get:()=>e[i],enumerable:!(s=t2(e,i))||s.enumerable});return t})(t8({},"__esModule",{value:!0}),t);function t6(t){return t instanceof String&&s.has(t)}function et(t){return s.get(t)||[]}var ee=t4({"src/lib/args/pathspec.ts"(){s=new WeakMap}}),er=t4({"src/lib/errors/git-error.ts"(){i=class extends Error{constructor(t,e){super(e),this.task=t,Object.setPrototypeOf(this,new.target.prototype)}}}}),es=t4({"src/lib/errors/git-response-error.ts"(){er(),a=class extends i{constructor(t,e){super(void 0,e||String(t)),this.git=t}}}}),ei=t4({"src/lib/errors/task-configuration-error.ts"(){er(),n=class extends i{constructor(t){super(void 0,t)}}}});function ea(t){return"function"!=typeof t?c:t}function en(t){return"function"==typeof t&&t!==c}function eo(t,e){let r=t.indexOf(e);return r<=0?[t,""]:[t.substr(0,r),t.substr(r+1)]}function ec(t,e=0){return m(t)&&t.length>e?t[e]:void 0}function eu(t,e=0){if(m(t)&&t.length>e)return t[t.length-1-e]}function el(t="",e=!0,r="\n"){return t.split(r).reduce((t,r)=>{let s=e?r.trim():r;return s&&t.push(s),t},[])}function eh(t,e){return el(t,!0).map(t=>e(t))}function ef(t){return(0,tX.exists)(t,tX.FOLDER)}function ep(t,e){return Array.isArray(t)?t.includes(e)||t.push(e):t.add(e),e}function em(t,e){return Array.isArray(t)&&!t.includes(e)&&t.push(e),t}function ed(t,e){if(Array.isArray(t)){let r=t.indexOf(e);r>=0&&t.splice(r,1)}else t.delete(e);return e}function eg(t){return Array.isArray(t)?t:[t]}function ew(t){return t.replace(/[\s-]+(.)/g,(t,e)=>e.toUpperCase())}function ey(t){return eg(t).map(t=>t instanceof String?t:String(t))}function eb(t,e=0){if(null==t)return e;let r=parseInt(t,10);return Number.isNaN(r)?e:r}function ek(t,e){let r=[];for(let s=0,i=t.length;s<i;s++)r.push(e,t[s]);return r}function ev(t){return(Array.isArray(t)?tV.Buffer.concat(t):t).toString("utf-8")}function eT(t,e){let r={};return e.forEach(e=>{void 0!==t[e]&&(r[e]=t[e])}),r}function eR(t=0){return new Promise(e=>setTimeout(e,t))}function e_(t){if(!1!==t)return t}var e$=t4({"src/lib/utils/util.ts"(){eO(),o="\0",c=()=>{},u=Object.prototype.toString.call.bind(Object.prototype.toString)}});function eE(t,e,r){return e(t)?t:arguments.length>2?r:void 0}function eS(t,e){let r=t6(t)?"string":typeof t;return/number|string|boolean/.test(r)&&(!e||!e.includes(r))}function ex(t){return!!t&&"[object Object]"===u(t)}function eC(t){return"function"==typeof t}var eO=t4({"src/lib/utils/argument-filters.ts"(){ee(),e$(),l=t=>Array.isArray(t),h=t=>"number"==typeof t,f=t=>"string"==typeof t,p=t=>f(t)||Array.isArray(t)&&t.every(f),m=t=>!(null==t||"number|boolean|function".includes(typeof t))&&"number"==typeof t.length}}),eA=t4({"src/lib/utils/exit-codes.ts"(){var t;(t=d||{})[t.SUCCESS=0]="SUCCESS",t[t.ERROR=1]="ERROR",t[t.NOT_FOUND=-2]="NOT_FOUND",t[t.UNCLEAN=128]="UNCLEAN",d=t}}),eF=t4({"src/lib/utils/git-output-streams.ts"(){g=class t{constructor(t,e){this.stdOut=t,this.stdErr=e}asStrings(){return new t(this.stdOut.toString("utf8"),this.stdErr.toString("utf8"))}}}});function eL(){throw Error("LineParser:useMatches not implemented")}var eD=t4({"src/lib/utils/line-parser.ts"(){w=class{constructor(t,e){this.matches=[],this.useMatches=eL,this.parse=(t,e)=>(this.resetMatches(),!!this._regExp.every((e,r)=>this.addMatch(e,r,t(r)))&&!1!==this.useMatches(e,this.prepareMatches())),this._regExp=Array.isArray(t)?t:[t],e&&(this.useMatches=e)}resetMatches(){this.matches.length=0}prepareMatches(){return this.matches}addMatch(t,e,r){let s=r&&t.exec(r);return s&&this.pushMatch(e,s),!!s}pushMatch(t,e){this.matches.push(...e.slice(1))}},y=class extends w{addMatch(t,e,r){return/^remote:\s/.test(String(r))&&super.addMatch(t,e,r)}pushMatch(t,e){(t>0||e.length>1)&&super.pushMatch(t,e)}}}});function eP(...t){let e=process.cwd(),r=Object.assign({baseDir:e,...b},...t.filter(t=>"object"==typeof t&&t));return r.baseDir=r.baseDir||e,r.trimmed=!0===r.trimmed,r}var eM=t4({"src/lib/utils/simple-git-options.ts"(){b={binary:"git",maxConcurrentProcesses:5,config:[],trimmed:!1}}});function eB(t,e=[]){return ex(t)?Object.keys(t).reduce((e,r)=>{let s=t[r];if(t6(s))e.push(s);else if(eS(s,["boolean"]))e.push(r+"="+s);else if(Array.isArray(s))for(let t of s)eS(t,["string","number"])||e.push(r+"="+t);else e.push(r);return e},e):e}function ej(t,e=0,r=!1){var s;let i,a=[];for(let r=0,s=e<0?t.length:e;r<s;r++)"string|number".includes(typeof t[r])&&a.push(String(t[r]));return eB(eN(t),a),r||a.push(...(i="function"==typeof eu(s=t),ey(eE(eu(s,+!!i),l,[])))),a}function eN(t){let e=eC(eu(t));return eE(eu(t,+!!e),ex)}function eI(t,e=!0){let r=ea(eu(t));return e||en(r)?r:void 0}var eU=t4({"src/lib/utils/task-options.ts"(){eO(),e$(),ee()}});function eq(t,e){return t(e.stdOut,e.stdErr)}function eH(t,e,r,s=!0){return eg(r).forEach(r=>{for(let i=el(r,s),a=0,n=i.length;a<n;a++){let r=(t=0)=>{if(!(a+t>=n))return i[a+t]};e.some(({parse:e})=>e(r,t))}}),t}var eG=t4({"src/lib/utils/task-parser.ts"(){e$()}}),eW={};t7(eW,{ExitCodes:()=>d,GitOutputStreams:()=>g,LineParser:()=>w,NOOP:()=>c,NULL:()=>o,RemoteLineParser:()=>y,append:()=>ep,appendTaskOptions:()=>eB,asArray:()=>eg,asCamelCase:()=>ew,asFunction:()=>ea,asNumber:()=>eb,asStringArray:()=>ey,bufferToString:()=>ev,callTaskParser:()=>eq,createInstanceConfig:()=>eP,delay:()=>eR,filterArray:()=>l,filterFunction:()=>eC,filterHasLength:()=>m,filterNumber:()=>h,filterPlainObject:()=>ex,filterPrimitives:()=>eS,filterString:()=>f,filterStringOrStringArray:()=>p,filterType:()=>eE,first:()=>ec,folderExists:()=>ef,forEachLineWithContent:()=>eh,getTrailingOptions:()=>ej,including:()=>em,isUserFunction:()=>en,last:()=>eu,objectToString:()=>u,orVoid:()=>e_,parseStringResponse:()=>eH,pick:()=>eT,prefixedArray:()=>ek,remove:()=>ed,splitOn:()=>eo,toLinesWithContent:()=>el,trailingFunctionArgument:()=>eI,trailingOptionsArgument:()=>eN});var ez=t4({"src/lib/utils/index.ts"(){eO(),eA(),eF(),eD(),eM(),eU(),eG(),e$()}}),eK={};function eQ(t){switch(t){case"bare":return eX();case"root":return eV()}return{commands:["rev-parse","--is-inside-work-tree"],format:"utf-8",onError:v,parser:T}}function eV(){return{commands:["rev-parse","--git-dir"],format:"utf-8",onError:v,parser:t=>/^\.(git)?$/.test(t.trim())}}function eX(){return{commands:["rev-parse","--is-bare-repository"],format:"utf-8",onError:v,parser:T}}t7(eK,{CheckRepoActions:()=>k,checkIsBareRepoTask:()=>eX,checkIsRepoRootTask:()=>eV,checkIsRepoTask:()=>eQ});var eY=t4({"src/lib/tasks/check-is-repo.ts"(){var t;ez(),(t=k||{}).BARE="bare",t.IN_TREE="tree",t.IS_REPO_ROOT="root",k=t,v=({exitCode:t},e,r,s)=>{if(128===t&&/(Not a git repository|Kein Git-Repository)/i.test(String(e)))return r(Buffer.from("false"));s(e)},T=t=>"true"===t.trim()}}),eJ=t4({"src/lib/responses/CleanSummary.ts"(){ez(),R=class{constructor(t){this.dryRun=t,this.paths=[],this.files=[],this.folders=[]}},_=/^[a-z]+\s*/i,$=/^[a-z]+\s+[a-z]+\s*/i,E=/\/$/}}),eZ={};function e0(t){return{commands:S,format:"empty",parser:t}}function e1(t){return{commands:S,format:"empty",parser(){throw"string"==typeof t?new n(t):t}}}function e8(t,e=!1){return{commands:t,format:"utf-8",parser:t=>e?String(t).trim():t}}function e2(t){return{commands:t,format:"buffer",parser:t=>t}}function e3(t){return"buffer"===t.format}function e9(t){return"empty"===t.format||!t.commands.length}t7(eZ,{EMPTY_COMMANDS:()=>S,adhocExecTask:()=>e0,configurationErrorTask:()=>e1,isBufferTask:()=>e3,isEmptyTask:()=>e9,straightThroughBufferTask:()=>e2,straightThroughStringTask:()=>e8});var e4=t4({"src/lib/tasks/task.ts"(){ei(),S=[]}}),e7={};function e5(t,e){let r,s,i,{cleanMode:a,options:n,valid:o}=(s=[],i={cleanMode:!1,options:!0},t.replace(/[^a-z]i/g,"").split("").forEach(t=>{var e,a;"f"===(e=t)||"n"===e?(r=t,i.cleanMode=!0):i.options=i.options&&(a=s[s.length]=`-${t}`,/^-[a-z]$/i.test(a)&&F.has(a.charAt(1)))}),{cleanMode:r,options:s,valid:i});return a?o.options?(n.push(...e),n.some(re))?e1(x):e6(a,n):e1(O+JSON.stringify(t)):e1(C)}function e6(t,e){return{commands:["clean",`-${t}`,...e],format:"utf-8",parser:e=>{var r;let s,i;return s=new R(r="n"===t),i=r?$:_,el(e).forEach(t=>{let e=t.replace(i,"");s.paths.push(e),(E.test(e)?s.folders:s.files).push(e)}),s}}}function rt(t){return Array.isArray(t)&&t.every(t=>F.has(t))}function re(t){return/^-[^\-]/.test(t)?t.indexOf("i")>0:"--interactive"===t}t7(e7,{CONFIG_ERROR_INTERACTIVE_MODE:()=>x,CONFIG_ERROR_MODE_REQUIRED:()=>C,CONFIG_ERROR_UNKNOWN_OPTION:()=>O,CleanOptions:()=>A,cleanTask:()=>e6,cleanWithOptionsTask:()=>e5,isCleanOptionsArray:()=>rt});var rr=t4({"src/lib/tasks/clean.ts"(){var t;eJ(),ez(),e4(),x="Git clean interactive mode is not supported",C='Git clean mode parameter ("n" or "f") is required',O="Git clean unknown option found in: ",(t=A||{}).DRY_RUN="n",t.FORCE="f",t.IGNORED_INCLUDED="x",t.IGNORED_ONLY="X",t.EXCLUDING="e",t.QUIET="q",t.RECURSIVE="d",F=new Set(["i",...ey(Object.values(A=t))])}});function*rs(t,e=null){let r=t.split("\0");for(let t=0,s=r.length-1;t<s;){let s=r[t++].replace(/^(file):/,""),i=r[t++],a=e;if(i.includes("\n")){let t=eo(i,"\n");a=t[0],i=t[1]}yield{file:s,key:a,value:i}}}var ri=t4({"src/lib/responses/ConfigList.ts"(){ez(),L=class{constructor(){this.files=[],this.values=Object.create(null)}get all(){return this._all||(this._all=this.files.reduce((t,e)=>Object.assign(t,this.values[e]),{})),this._all}addFile(t){if(!(t in this.values)){let e=eu(this.files);this.values[t]=e?Object.create(this.values[e]):{},this.files.push(t)}return this.values[t]}addValue(t,e,r){let s=this.addFile(t);Object.hasOwn(s,e)?Array.isArray(s[e])?s[e].push(r):s[e]=[s[e],r]:s[e]=r,this._all=void 0}}}});function ra(t,e){return"string"==typeof t&&Object.hasOwn(D,t)?t:e}var rn=t4({"src/lib/tasks/config.ts"(){var t;ri(),ez(),(t=D||{}).system="system",t.global="global",t.local="local",t.worktree="worktree",D=t}}),ro=t4({"src/lib/tasks/diff-name-status.ts"(){var t;(t=P||{}).ADDED="A",t.COPIED="C",t.DELETED="D",t.MODIFIED="M",t.RENAMED="R",t.CHANGED="T",t.UNMERGED="U",t.UNKNOWN="X",t.BROKEN="B",M=new Set(Object.values(P=t))}}),rc=t4({"src/lib/tasks/grep.ts"(){ez(),e4(),B=["-h"],j=Symbol("grepQuery"),I=class{constructor(){this[N]=[]}*[(N=j,Symbol.iterator)](){for(let t of this[j])yield t}and(...t){return t.length&&this[j].push("--and","(",...ek(t,"-e"),")"),this}param(...t){return this[j].push(...ek(t,"-e")),this}}}}),ru={};function rl(t,e){let r=["reset"];return rf(t)&&r.push(`--${t}`),r.push(...e),e8(r)}function rh(t){if(rf(t))return t;switch(typeof t){case"string":case"undefined":return"soft"}}function rf(t){return"string"==typeof t&&q.includes(t)}t7(ru,{ResetMode:()=>U,getResetMode:()=>rh,resetTask:()=>rl});var rp=t4({"src/lib/tasks/reset.ts"(){var t;ez(),e4(),(t=U||{}).MIXED="mixed",t.SOFT="soft",t.HARD="hard",t.MERGE="merge",t.KEEP="keep",q=ey(Object.values(U=t))}});function rm(t,e,r){return e&&String(e).replace(/\s*/,"")?(s,...i)=>{t(`%s ${s}`,e,...i),r&&r(s,...i)}:r?(e,...s)=>{t(e,...s),r(e,...s)}:t}function rd(t,e,r,s=(0,tY.default)("simple-git")){let i=t&&`[${t}]`||"",a=[],n="string"==typeof e?s.extend(e):e,o=function(t,e,{namespace:r}){if("string"==typeof t)return t;let s=e&&e.namespace||"";return s.startsWith(r)?s.substr(r.length+1):s||r}(eE(e,f),n,s);return function e(r){let a=r&&`[${r}]`||"",o=n&&rm(n,a)||c,l=rm(s,`${i} ${a}`,o);return Object.assign(n?o:l,{label:t,sibling:u,info:l,step:e})}(r);function u(e,r){return ep(a,rd(t,o.replace(/^[^:]+/,e),r,s))}}var rg=t4({"src/lib/git-logger.ts"(){ez(),tY.default.formatters.L=t=>String(m(t)?t.length:"-"),tY.default.formatters.B=t=>Buffer.isBuffer(t)?t.toString("utf8"):u(t)}}),rw=t4({"src/lib/runners/tasks-pending-queue.ts"(){er(),rg(),H=class t{constructor(t="GitExecutor"){this.logLabel=t,this._queue=new Map}withProgress(t){return this._queue.get(t)}createProgress(e){let r=t.getName(e.commands[0]);return{task:e,logger:rd(this.logLabel,r),name:r}}push(t){let e=this.createProgress(t);return e.logger("Adding task to the queue, commands = %o",t.commands),this._queue.set(t,e),e}fatal(t){for(let[e,{logger:r}]of Array.from(this._queue.entries()))e===t.task?(r.info("Failed %o",t),r("Fatal exception, any as-yet un-started tasks run through this executor will not be attempted")):r.info("A fatal exception occurred in a previous task, the queue has been purged: %o",t.message),this.complete(e);if(0!==this._queue.size)throw Error(`Queue size should be zero after fatal: ${this._queue.size}`)}complete(t){this.withProgress(t)&&this._queue.delete(t)}attempt(t){let e=this.withProgress(t);if(!e)throw new i(void 0,"TasksPendingQueue: attempt called for an unknown task");return e.logger("Starting task"),e}static getName(e="empty"){return`task:${e}:${++t.counter}`}static{this.counter=0}}}});function ry(t,e){return{method:ec(t.commands)||"",commands:e}}function rb(t,e,r,s){return i=>{r("%s received %L bytes",e,i),s("%B",i),t.push(i)}}var rk=t4({"src/lib/runners/git-executor-chain.ts"(){er(),e4(),ez(),rw(),G=class{constructor(t,e,r){this._executor=t,this._scheduler=e,this._plugins=r,this._chain=Promise.resolve(),this._queue=new H}get cwd(){return this._cwd||this._executor.cwd}set cwd(t){this._cwd=t}get env(){return this._executor.env}get outputHandler(){return this._executor.outputHandler}chain(){return this}push(t){return this._queue.push(t),this._chain=this._chain.then(()=>this.attemptTask(t))}async attemptTask(t){let e=await this._scheduler.next(),r=()=>this._queue.complete(t);try{let{logger:e}=this._queue.attempt(t);return await (e9(t)?this.attemptEmptyTask(t,e):this.attemptRemoteTask(t,e))}catch(e){throw this.onFatalException(t,e)}finally{r(),e()}}onFatalException(t,e){let r=e instanceof i?Object.assign(e,{task:t}):new i(t,e&&String(e));return this._chain=Promise.resolve(),this._queue.fatal(r),r}async attemptRemoteTask(t,e){let r=this._plugins.exec("spawn.binary","",ry(t,t.commands)),s=this._plugins.exec("spawn.args",[...t.commands],ry(t,t.commands)),i=await this.gitResponse(t,r,s,this.outputHandler,e.step("SPAWN")),a=await this.handleTaskData(t,s,i,e.step("HANDLE"));return(e("passing response to task's parser as a %s",t.format),e3(t))?eq(t.parser,a):eq(t.parser,a.asStrings())}async attemptEmptyTask(t,e){return e("empty task bypassing child process to call to task's parser"),t.parser(this)}handleTaskData(t,e,r,s){let{exitCode:i,rejection:a,stdOut:n,stdErr:o}=r;return new Promise((c,l)=>{s("Preparing to handle process response exitCode=%d stdOut=",i);let{error:h}=this._plugins.exec("task.error",{error:a},{...ry(t,e),...r});return h&&t.onError?(s.info("exitCode=%s handling with custom error handler"),t.onError(r,h,t=>{s.info("custom error handler treated as success"),s("custom error returned a %s",u(t)),c(new g(Array.isArray(t)?Buffer.concat(t):t,Buffer.concat(o)))},l)):h?(s.info("handling as error: exitCode=%s stdErr=%s rejection=%o",i,o.length,a),l(h)):void(s.info("retrieving task output complete"),c(new g(Buffer.concat(n),Buffer.concat(o))))})}async gitResponse(t,e,r,s,i){let a=i.sibling("output"),n=this._plugins.exec("spawn.options",{cwd:this.cwd,env:this.env,windowsHide:!0},ry(t,t.commands));return new Promise(o=>{let c=[],u=[];i.info("%s %o",e,r),i("%O",n);let l=this._beforeSpawn(t,r);if(l)return o({stdOut:c,stdErr:u,exitCode:9901,rejection:l});this._plugins.exec("spawn.before",void 0,{...ry(t,r),kill(t){l=t||l}});let h=(0,tJ.spawn)(e,r,n);h.stdout.on("data",rb(c,"stdOut",i,a.step("stdOut"))),h.stderr.on("data",rb(u,"stdErr",i,a.step("stdErr"))),h.on("error",t=>{i("[ERROR] child process exception %o",t),u.push(Buffer.from(String(t.stack),"ascii"))}),s&&(i("Passing child process stdOut/stdErr to custom outputHandler"),s(e,h.stdout,h.stderr,[...r])),this._plugins.exec("spawn.after",void 0,{...ry(t,r),spawned:h,close(t,e){o({stdOut:c,stdErr:u,exitCode:t,rejection:l||e})},kill(t){h.killed||(l=t,h.kill("SIGINT"))}})})}_beforeSpawn(t,e){let r;return this._plugins.exec("spawn.before",void 0,{...ry(t,e),kill(t){r=t||r}}),r}}}}),rv={};t7(rv,{GitExecutor:()=>W});var rT=t4({"src/lib/runners/git-executor.ts"(){rk(),W=class{constructor(t,e,r){this.cwd=t,this._scheduler=e,this._plugins=r,this._chain=new G(this,this._scheduler,this._plugins)}chain(){return new G(this,this._scheduler,this._plugins)}push(t){return this._chain.push(t)}}}}),rR=t4({"src/lib/task-callback.ts"(){es(),ez()}});function r_(t,e){return e0(r=>{if(!ef(t))throw Error(`Git.cwd: cannot change to non-directory "${t}"`);return(e||r).cwd=t})}var r$=t4({"src/lib/tasks/change-working-directory.ts"(){ez(),e4()}});function rE(t){let e=["checkout",...t];return"-b"===e[1]&&e.includes("-B")&&(e[1]=ed(e,"-B")),e8(e)}var rS=t4({"src/lib/tasks/checkout.ts"(){ez(),e4()}}),rx=t4({"src/lib/tasks/count-objects.ts"(){ez(),z=new w(/([a-z-]+): (\d+)$/,(t,[e,r])=>{let s=ew(e);Object.hasOwn(t,s)&&(t[s]=eb(r))})}});function rC(t){return eH({author:null,branch:"",commit:"",root:!1,summary:{changes:0,insertions:0,deletions:0}},K,t)}var rO=t4({"src/lib/parsers/parse-commit.ts"(){ez(),K=[new w(/^\[([^\s]+)( \([^)]+\))? ([^\]]+)/,(t,[e,r,s])=>{t.branch=e,t.commit=s,t.root=!!r}),new w(/\s*Author:\s(.+)/i,(t,[e])=>{let r=e.split("<"),s=r.pop();s&&s.includes("@")&&(t.author={email:s.substr(0,s.length-1),name:r.join("<").trim()})}),new w(/(\d+)[^,]*(?:,\s*(\d+)[^,]*)(?:,\s*(\d+))/g,(t,[e,r,s])=>{t.summary.changes=parseInt(e,10)||0,t.summary.insertions=parseInt(r,10)||0,t.summary.deletions=parseInt(s,10)||0}),new w(/^(\d+)[^,]*(?:,\s*(\d+)[^(]+\(([+-]))?/,(t,[e,r,s])=>{t.summary.changes=parseInt(e,10)||0;let i=parseInt(r,10)||0;"-"===s?t.summary.deletions=i:"+"===s&&(t.summary.insertions=i)})]}}),rA=t4({"src/lib/tasks/commit.ts"(){rO(),ez(),e4()}}),rF=t4({"src/lib/tasks/first-commit.ts"(){ez(),e4()}}),rL=t4({"src/lib/tasks/hash-object.ts"(){e4()}}),rD=t4({"src/lib/responses/InitSummary.ts"(){Q=class{constructor(t,e,r,s){this.bare=t,this.path=e,this.existing=r,this.gitDir=s}},V=/^Init.+ repository in (.+)$/,X=/^Rein.+ in (.+)$/}}),rP=t4({"src/lib/tasks/init.ts"(){rD(),Y="--bare"}});function rM(t){for(let e=0;e<t.length;e++){let r=J.exec(t[e]);if(r)return`--${r[1]}`}return""}function rB(t){return J.test(t)}var rj=t4({"src/lib/args/log-format.ts"(){J=/^--(stat|numstat|name-only|name-status)(=|$)/}}),rN=t4({"src/lib/responses/DiffSummary.ts"(){Z=class{constructor(){this.changed=0,this.deletions=0,this.insertions=0,this.files=[]}}}});function rI(t=""){let e=ts[t];return t=>eH(new Z,e,t,!1)}var rU=t4({"src/lib/parsers/parse-diff-summary.ts"(){rj(),rN(),ro(),ez(),tt=[new w(/^(.+)\s+\|\s+(\d+)(\s+[+\-]+)?$/,(t,[e,r,s=""])=>{t.files.push({file:e.trim(),changes:eb(r),insertions:s.replace(/[^+]/g,"").length,deletions:s.replace(/[^-]/g,"").length,binary:!1})}),new w(/^(.+) \|\s+Bin ([0-9.]+) -> ([0-9.]+) ([a-z]+)/,(t,[e,r,s])=>{t.files.push({file:e.trim(),before:eb(r),after:eb(s),binary:!0})}),new w(/(\d+) files? changed\s*((?:, \d+ [^,]+){0,2})/,(t,[e,r])=>{let s=/(\d+) i/.exec(r),i=/(\d+) d/.exec(r);t.changed=eb(e),t.insertions=eb(s?.[1]),t.deletions=eb(i?.[1])})],te=[new w(/(\d+)\t(\d+)\t(.+)$/,(t,[e,r,s])=>{let i=eb(e),a=eb(r);t.changed++,t.insertions+=i,t.deletions+=a,t.files.push({file:s,changes:i+a,insertions:i,deletions:a,binary:!1})}),new w(/-\t-\t(.+)$/,(t,[e])=>{t.changed++,t.files.push({file:e,after:0,before:0,binary:!0})})],tr=[new w(/(.+)$/,(t,[e])=>{t.changed++,t.files.push({file:e,changes:0,insertions:0,deletions:0,binary:!1})})],ts={"":tt,"--stat":tt,"--numstat":te,"--name-status":[new w(/([ACDMRTUXB])([0-9]{0,3})\t(.[^\t]*)(\t(.[^\t]*))?$/,(t,[e,r,s,i,a])=>{t.changed++,t.files.push({file:a??s,changes:0,insertions:0,deletions:0,binary:!1,status:e_(M.has(e)&&e),from:e_(!!a&&s!==a&&s),similarity:eb(r)})})],"--name-only":tr}}});function rq(t=tn,e=to,r=""){let s=rI(r);return function(r){let i=el(r.trim(),!1,ti).map(function(r){var i;let a=r.split(ta),n=(i=a[0].split(t),e.reduce((t,e,r)=>(t[e]=i[r]||"",t),Object.create({diff:null})));return a.length>1&&a[1].trim()&&(n.diff=s(a[1])),n});return{all:i,latest:i.length&&i[0]||null,total:i.length}}}var rH=t4({"src/lib/parsers/parse-list-log-summary.ts"(){ez(),rU(),rj(),ti="òòòòòò ",ta=" òò",tn=" ò ",to=["hash","date","message","refs","author_name","author_email"]}}),rG={};function rW(t){let e=rM(t),r=["diff"];return""===e&&(e="--stat",r.push("--stat=4096")),r.push(...t),rz(r)||{commands:r,format:"utf-8",parser:rI(e)}}function rz(t){let e=t.filter(rB);return e.length>1?e1(`Summary flags are mutually exclusive - pick one of ${e.join(",")}`):e.length&&t.includes("-z")?e1(`Summary flag ${e} parsing is not compatible with null termination option '-z'`):void 0}t7(rG,{diffSummaryTask:()=>rW,validateLogFormatConfig:()=>rz});var rK=t4({"src/lib/tasks/diff.ts"(){rj(),rU(),e4()}});function rQ(t={},e=[]){var r;let i,a,n=eE(t.splitter,f,tn),[o,c]=(r=ex(t.format)?t.format:{hash:"%H",date:!1===t.strictDate?"%ai":"%aI",message:"%s",refs:"%D",body:t.multiLine?"%B":"%b",author_name:!1!==t.mailMap?"%aN":"%an",author_email:!1!==t.mailMap?"%aE":"%ae"},i=[],a=[],Object.keys(r).forEach(t=>{i.push(t),a.push(String(r[t]))}),[i,a.join(n)]),u=[],l=[`--pretty=format:${ti}${c}${ta}`,...e],h=t.n||t["max-count"]||t.maxCount;if(h&&l.push(`--max-count=${h}`),t.from||t.to){let e=!1!==t.symmetric?"...":"..";u.push(`${t.from||""}${e}${t.to||""}`)}return f(t.file)&&l.push("--follow",function(...t){let e=new String(t);return s.set(e,t),e}(t.file)),eB(Object.keys(t).reduce((e,r)=>(r in tc||(e[r]=t[r]),e),{}),l),{fields:o,splitter:n,commands:[...l,...u]}}var rV=t4({"src/lib/tasks/log.ts"(){var t;rj(),ee(),rH(),ez(),e4(),rK(),(t=tc||{})[t["--pretty"]=0]="--pretty",t[t["max-count"]=1]="max-count",t[t.maxCount=2]="maxCount",t[t.n=3]="n",t[t.file=4]="file",t[t.format=5]="format",t[t.from=6]="from",t[t.to=7]="to",t[t.splitter=8]="splitter",t[t.symmetric=9]="symmetric",t[t.mailMap=10]="mailMap",t[t.multiLine=11]="multiLine",t[t.strictDate=12]="strictDate",tc=t}}),rX=t4({"src/lib/responses/MergeSummary.ts"(){tu=class{constructor(t,e=null,r){this.reason=t,this.file=e,this.meta=r}toString(){return`${this.file}:${this.reason}`}},tl=class{constructor(){this.conflicts=[],this.merges=[],this.result="success"}get failed(){return this.conflicts.length>0}get reason(){return this.result}toString(){return this.conflicts.length?`CONFLICTS: ${this.conflicts.join(", ")}`:"OK"}}}}),rY=t4({"src/lib/responses/PullSummary.ts"(){th=class{constructor(){this.remoteMessages={all:[]},this.created=[],this.deleted=[],this.files=[],this.deletions={},this.insertions={},this.summary={changes:0,deletions:0,insertions:0}}},tf=class{constructor(){this.remote="",this.hash={local:"",remote:""},this.branch={local:"",remote:""},this.message=""}toString(){return this.message}}}});function rJ(t){return t.objects=t.objects||{compressing:0,counting:0,enumerating:0,packReused:0,reused:{count:0,delta:0},total:{count:0,delta:0}}}function rZ(t){let e=/^\s*(\d+)/.exec(t),r=/delta (\d+)/i.exec(t);return{count:eb(e&&e[1]||"0"),delta:eb(r&&r[1]||"0")}}var r0=t4({"src/lib/parsers/parse-remote-objects.ts"(){ez(),tp=[new y(/^remote:\s*(enumerating|counting|compressing) objects: (\d+),/i,(t,[e,r])=>{let s=e.toLowerCase();Object.assign(rJ(t.remoteMessages),{[s]:eb(r)})}),new y(/^remote:\s*(enumerating|counting|compressing) objects: \d+% \(\d+\/(\d+)\),/i,(t,[e,r])=>{let s=e.toLowerCase();Object.assign(rJ(t.remoteMessages),{[s]:eb(r)})}),new y(/total ([^,]+), reused ([^,]+), pack-reused (\d+)/i,(t,[e,r,s])=>{let i=rJ(t.remoteMessages);i.total=rZ(e),i.reused=rZ(r),i.packReused=eb(s)})]}});function r1(t,e){return eH({remoteMessages:new td},tm,e)}var r8=t4({"src/lib/parsers/parse-remote-messages.ts"(){ez(),r0(),tm=[new y(/^remote:\s*(.+)$/,(t,[e])=>(t.remoteMessages.all.push(e.trim()),!1)),...tp,new y([/create a (?:pull|merge) request/i,/\s(https?:\/\/\S+)$/],(t,[e])=>{t.remoteMessages.pullRequestUrl=e}),new y([/found (\d+) vulnerabilities.+\(([^)]+)\)/i,/\s(https?:\/\/\S+)$/],(t,[e,r,s])=>{t.remoteMessages.vulnerabilities={count:eb(e),summary:r,url:s}})],td=class{constructor(){this.all=[]}}}}),r2=t4({"src/lib/parsers/parse-pull.ts"(){rY(),ez(),r8(),tg=/(\d+)\D+((\d+)\D+\(\+\))?(\D+(\d+)\D+\(-\))?/,tw=/^(create|delete) mode \d+ (.+)/,ty=[new w(/^\s*(.+?)\s+\|\s+\d+\s*(\+*)(-*)/,(t,[e,r,s])=>{t.files.push(e),r&&(t.insertions[e]=r.length),s&&(t.deletions[e]=s.length)}),new w(tg,(t,[e,,r,,s])=>(void 0!==r||void 0!==s)&&(t.summary.changes=+e||0,t.summary.insertions=+r||0,t.summary.deletions=+s||0,!0)),new w(tw,(t,[e,r])=>{ep(t.files,r),ep("create"===e?t.created:t.deleted,r)})],tb=[new w(/^from\s(.+)$/i,(t,[e])=>void(t.remote=e)),new w(/^fatal:\s(.+)$/,(t,[e])=>void(t.message=e)),new w(/([a-z0-9]+)\.\.([a-z0-9]+)\s+(\S+)\s+->\s+(\S+)$/,(t,[e,r,s,i])=>{t.branch.local=s,t.hash.local=e,t.branch.remote=i,t.hash.remote=r})],tk=(t,e)=>Object.assign(new th,eH(new th,ty,[t,e]),r1(t,e))}}),r3=t4({"src/lib/parsers/parse-merge.ts"(){rX(),ez(),r2(),tv=[new w(/^Auto-merging\s+(.+)$/,(t,[e])=>{t.merges.push(e)}),new w(/^CONFLICT\s+\((.+)\): Merge conflict in (.+)$/,(t,[e,r])=>{t.conflicts.push(new tu(e,r))}),new w(/^CONFLICT\s+\((.+\/delete)\): (.+) deleted in (.+) and/,(t,[e,r,s])=>{t.conflicts.push(new tu(e,r,{deleteRef:s}))}),new w(/^CONFLICT\s+\((.+)\):/,(t,[e])=>{t.conflicts.push(new tu(e,null))}),new w(/^Automatic merge failed;\s+(.+)$/,(t,[e])=>{t.result=e})],tT=(t,e)=>Object.assign(tR(t,e),tk(t,e)),tR=t=>eH(new tl,tv,t)}});function r9(t){return t.length?{commands:["merge",...t],format:"utf-8",parser(t,e){let r=tT(t,e);if(r.failed)throw new a(r);return r}}:e1("Git.merge requires at least one option")}var r4=t4({"src/lib/tasks/merge.ts"(){es(),r3(),e4()}}),r7=t4({"src/lib/parsers/parse-push.ts"(){ez(),r8(),t_=[new w(/^Pushing to (.+)$/,(t,[e])=>{t.repo=e}),new w(/^updating local tracking ref '(.+)'/,(t,[e])=>{t.ref={...t.ref||{},local:e}}),new w(/^[=*-]\s+([^:]+):(\S+)\s+\[(.+)]$/,(t,[e,r,s])=>{let i,a,n;t.pushed.push((i=s.includes("deleted"),a=s.includes("tag")||/^refs\/tags/.test(e),{deleted:i,tag:a,branch:!a,new:!(n=!s.includes("new")),alreadyUpdated:n,local:e,remote:r}))}),new w(/^Branch '([^']+)' set up to track remote branch '([^']+)' from '([^']+)'/,(t,[e,r,s])=>{t.branch={...t.branch||{},local:e,remote:r,remoteName:s}}),new w(/^([^:]+):(\S+)\s+([a-z0-9]+)\.\.([a-z0-9]+)$/,(t,[e,r,s,i])=>{t.update={head:{local:e,remote:r},hash:{from:s,to:i}}})],t$=(t,e)=>{let r=tE(t,e),s=r1(t,e);return{...r,...s}},tE=(t,e)=>eH({pushed:[]},t_,[t,e])}}),r5={};function r6(t={},e){return ep(e,"--tags"),st(t,e)}function st(t={},e){let r=["push",...e];return t.branch&&r.splice(1,0,t.branch),t.remote&&r.splice(1,0,t.remote),ed(r,"-v"),ep(r,"--verbose"),ep(r,"--porcelain"),{commands:r,format:"utf-8",parser:t$}}t7(r5,{pushTagsTask:()=>r6,pushTask:()=>st});var se=t4({"src/lib/tasks/push.ts"(){r7(),ez()}}),sr=t4({"src/lib/tasks/show.ts"(){ez(),e4()}}),ss=t4({"src/lib/responses/FileStatusSummary.ts"(){tS=/^(.+)\0(.+)$/,tx=class{constructor(t,e,r){if(this.path=t,this.index=e,this.working_dir=r,"R"===e||"R"===r){const e=tS.exec(t)||[null,t,t];this.from=e[2]||"",this.path=e[1]||""}}}}});function si(t){let[e,r]=t.split(o);return{from:r||e,to:e}}function sa(t,e,r){return[`${t}${e}`,r]}function sn(t,...e){return e.map(e=>sa(t,e,(t,e)=>ep(t.conflicted,e)))}var so=t4({"src/lib/responses/StatusSummary.ts"(){ez(),ss(),tC=class{constructor(){this.not_added=[],this.conflicted=[],this.created=[],this.deleted=[],this.ignored=void 0,this.modified=[],this.renamed=[],this.files=[],this.staged=[],this.ahead=0,this.behind=0,this.current=null,this.tracking=null,this.detached=!1,this.isClean=()=>!this.files.length}},tO=new Map([sa(" ","A",(t,e)=>ep(t.created,e)),sa(" ","D",(t,e)=>ep(t.deleted,e)),sa(" ","M",(t,e)=>ep(t.modified,e)),sa("A"," ",(t,e)=>ep(t.created,e)&&ep(t.staged,e)),sa("A","M",(t,e)=>ep(t.created,e)&&ep(t.staged,e)&&ep(t.modified,e)),sa("D"," ",(t,e)=>ep(t.deleted,e)&&ep(t.staged,e)),sa("M"," ",(t,e)=>ep(t.modified,e)&&ep(t.staged,e)),sa("M","M",(t,e)=>ep(t.modified,e)&&ep(t.staged,e)),sa("R"," ",(t,e)=>{ep(t.renamed,si(e))}),sa("R","M",(t,e)=>{let r=si(e);ep(t.renamed,r),ep(t.modified,r.to)}),sa("!","!",(t,e)=>{ep(t.ignored=t.ignored||[],e)}),sa("?","?",(t,e)=>ep(t.not_added,e)),...sn("A","A","U"),...sn("D","D","U"),...sn("U","A","D","U"),["##",(t,e)=>{let r=/ahead (\d+)/.exec(e);t.ahead=r&&+r[1]||0,t.behind=(r=/behind (\d+)/.exec(e))&&+r[1]||0,r=/^(.+?(?=(?:\.{3}|\s|$)))/.exec(e),t.current=eE(r?.[1],f,null),r=/\.{3}(\S*)/.exec(e),t.tracking=eE(r?.[1],f,null),(r=/\son\s(\S+?)(?=\.{3}|$)/.exec(e))&&(t.current=eE(r?.[1],f,t.current)),t.detached=/\(no branch\)/.test(e)}]]),tA=function(t){let e=t.split(o),r=new tC;for(let t=0,s=e.length;t<s;){let s=e[t++].trim();s&&("R"===s.charAt(0)&&(s+=o+(e[t++]||"")),function(t,e){let r=e.trim();switch(" "){case r.charAt(2):return s(r.charAt(0),r.charAt(1),r.substr(3));case r.charAt(1):return s(" ",r.charAt(0),r.substr(2));default:return}function s(e,r,s){let i=`${e}${r}`,a=tO.get(i);a&&a(t,s),"##"!==i&&"!!"!==i&&t.files.push(new tx(s,e,r))}}(r,s))}return r}}}),sc=t4({"src/lib/tasks/status.ts"(){so(),tF=["--null","-z"]}});function su(t=0,e=0,r=0,s="",i=!0){return Object.defineProperty({major:t,minor:e,patch:r,agent:s,installed:i},"toString",{value(){return`${this.major}.${this.minor}.${this.patch}`},configurable:!1,enumerable:!1})}function sl(t){return t===tL?su(0,0,0,"",!1):eH(su(0,0,0,t),tD,t)}var sh=t4({"src/lib/tasks/version.ts"(){ez(),tL="installed=false",tD=[new w(/version (\d+)\.(\d+)\.(\d+)(?:\s*\((.+)\))?/,(t,[e,r,s,i=""])=>{Object.assign(t,su(eb(e),eb(r),eb(s),i))}),new w(/version (\d+)\.(\d+)\.(\D+)(.+)?$/,(t,[e,r,s,i=""])=>{Object.assign(t,su(eb(e),eb(r),s,i))})]}}),sf={};t7(sf,{SimpleGitApi:()=>tP});var sp=t4({"src/lib/simple-git-api.ts"(){rR(),r$(),rS(),rx(),rA(),rn(),rF(),rc(),rL(),rP(),rV(),r4(),se(),sr(),sc(),e4(),sh(),ez(),Object.assign((tP=class{constructor(t){this._executor=t}_runTask(t,e){let r=this._executor.chain(),s=r.push(t);return e&&function(t,e,r=c){e.then(t=>{r(null,t)},e=>{var s;let i;e?.task===t&&r(e instanceof a?(s=e,i=t=>{console.warn(`simple-git deprecation notice: accessing GitResponseError.${t} should be GitResponseError.git.${t}, this will no longer be available in version 3`),i=c},Object.create(s,Object.getOwnPropertyNames(s.git).reduce(function(t,e){return e in s||(t[e]={enumerable:!1,configurable:!1,get:()=>(i(e),s.git[e])}),t},{}))):e,void 0)})}(t,s,e),Object.create(this,{then:{value:s.then.bind(s)},catch:{value:s.catch.bind(s)},_executor:{value:r}})}add(t){return this._runTask(e8(["add",...eg(t)]),eI(arguments))}cwd(t){let e=eI(arguments);return"string"==typeof t?this._runTask(r_(t,this._executor),e):"string"==typeof t?.path?this._runTask(r_(t.path,t.root&&this._executor||void 0),e):this._runTask(e1("Git.cwd: workingDirectory must be supplied as a string"),e)}hashObject(t,e){var r;let s;return this._runTask((r=!0===e,s=["hash-object",t],r&&s.push("-w"),e8(s,!0)),eI(arguments))}init(t){return this._runTask(function(t=!1,e,r){let s=["init",...r];return t&&!s.includes(Y)&&s.splice(1,0,Y),{commands:s,format:"utf-8",parser:t=>(function(t,e,r){let s,i=String(r).trim();if(s=V.exec(i))return new Q(t,e,!1,s[1]);if(s=X.exec(i))return new Q(t,e,!0,s[1]);let a="",n=i.split(" ");for(;n.length;)if("in"===n.shift()){a=n.join(" ");break}return new Q(t,e,/^re/i.test(i),a)})(s.includes("--bare"),e,t)}}(!0===t,this._executor.cwd,ej(arguments)),eI(arguments))}merge(){return this._runTask(r9(ej(arguments)),eI(arguments))}mergeFromTo(t,e){return f(t)&&f(e)?this._runTask(r9([t,e,...ej(arguments)]),eI(arguments,!1)):this._runTask(e1("Git.mergeFromTo requires that the 'remote' and 'branch' arguments are supplied as strings"))}outputHandler(t){return this._executor.outputHandler=t,this}push(){let t=st({remote:eE(arguments[0],f),branch:eE(arguments[1],f)},ej(arguments));return this._runTask(t,eI(arguments))}stash(){return this._runTask(e8(["stash",...ej(arguments)]),eI(arguments))}status(){var t;return this._runTask((t=ej(arguments),{format:"utf-8",commands:["status","--porcelain","-b","-u","--null",...t.filter(t=>!tF.includes(t))],parser:t=>tA(t)}),eI(arguments))}}).prototype,{checkout(){return this._runTask(rE(ej(arguments,1)),eI(arguments))},checkoutBranch(t,e){return this._runTask(rE(["-b",t,e,...ej(arguments)]),eI(arguments))},checkoutLocalBranch(t){return this._runTask(rE(["-b",t,...ej(arguments)]),eI(arguments))}},{commit(t,...e){var r,s,i;let a=eI(arguments),n=!p(t)&&e1("git.commit: requires the commit message to be supplied as a string/string[]")||(r=eg(t),s=eg(eE(e[0],p,[])),i=[...ey(eE(e[1],l,[])),...ej(arguments,0,!0)],{commands:["-c","core.abbrev=40","commit",...ek(r,"-m"),...s,...i],format:"utf-8",parser:rC});return this._runTask(n,a)}},{addConfig(t,e,...r){var s,i;let a;return this._runTask((s=!0===r[0],i=ra(r[1],"local"),a=["config",`--${i}`],s&&a.push("--add"),a.push(t,e),{commands:a,format:"utf-8",parser:t=>t}),eI(arguments))},getConfig(t,e){var r;let s;return this._runTask((r=ra(e,void 0),s=["config","--null","--show-origin","--get-all",t],r&&s.splice(1,0,`--${r}`),{commands:s,format:"utf-8",parser:e=>(function(t,e){let r=null,s=[],i=new Map;for(let a of rs(t,e))a.key===e&&(s.push(r=a.value),i.has(a.file)||i.set(a.file,[]),i.get(a.file).push(r));return{key:e,paths:Array.from(i.keys()),scopes:i,value:r,values:s}})(e,t)}),eI(arguments))},listConfig(...t){var e;let r;return this._runTask((e=ra(t[0],void 0),r=["config","--list","--show-origin","--null"],e&&r.push(`--${e}`),{commands:r,format:"utf-8",parser:t=>(function(t){let e=new L;for(let r of rs(t))e.addValue(r.file,String(r.key),r.value);return e})(t)}),eI(arguments))}},{countObjects(){return this._runTask({commands:["count-objects","--verbose"],format:"utf-8",parser:t=>eH({count:0,garbage:0,inPack:0,packs:0,prunePackable:0,size:0,sizeGarbage:0,sizePack:0},[z],t)})}},{firstCommit(){return this._runTask(e8(["rev-list","--max-parents=0","HEAD"],!0),eI(arguments))}},{grep(t){let e=eI(arguments),r=ej(arguments);for(let t of B)if(r.includes(t))return this._runTask(e1(`git.grep: use of "${t}" is not supported.`),e);"string"==typeof t&&(t=(function(...t){return new I().param(...t)})().param(t));let s=["grep","--null","-n","--full-name",...r,...t];return this._runTask({commands:s,format:"utf-8",parser:t=>{let e,r;return e=new Set,r={},eh(t,t=>{let[s,i,a]=t.split(o);e.add(s),(r[s]=r[s]||[]).push({line:eb(i),path:s,preview:a})}),{paths:e,results:r}}},e)}},{log(...t){var e,r;let s,i=eI(arguments),a=rQ(eN(arguments),ey(eE(arguments[0],l,[]))),n=function(t,e){return f(t)&&f(e)&&e1("git.log(string, string) should be replaced with git.log({ from: string, to: string })")}(...t)||rz(a.commands)||(s=rq((e=a).splitter,e.fields,rM(r=e.commands)),{commands:["log",...r],format:"utf-8",parser:s});return this._runTask(n,i)}},{showBuffer(){let t=["show",...ej(arguments,1)];return t.includes("--binary")||t.splice(1,0,"--binary"),this._runTask(e2(t),eI(arguments))},show(){let t=["show",...ej(arguments,1)];return this._runTask(e8(t),eI(arguments))}},{version(){return this._runTask({commands:["--version"],format:"utf-8",parser:sl,onError(t,e,r,s){if(-2===t.exitCode)return r(Buffer.from(tL));s(e)}})}})}}),sm={};t7(sm,{Scheduler:()=>tM});var sd=t4({"src/lib/runners/scheduler.ts"(){let t;ez(),rg(),t=0,tM=class{constructor(t=2){this.concurrency=t,this.logger=rd("","scheduler"),this.pending=[],this.running=[],this.logger("Constructed, concurrency=%s",t)}schedule(){if(!this.pending.length||this.running.length>=this.concurrency)return void this.logger("Schedule attempt ignored, pending=%s running=%s concurrency=%s",this.pending.length,this.running.length,this.concurrency);let t=ep(this.running,this.pending.shift());this.logger("Attempting id=%s",t.id),t.done(()=>{this.logger("Completing id=",t.id),ed(this.running,t),this.schedule()})}next(){let{promise:e,id:r}=ep(this.pending,(()=>{t++;let{promise:e,done:r}=(0,tZ.createDeferred)();return{promise:e,done:r,id:t}})());return this.logger("Scheduling id=%s",r),this.schedule(),e}}}}),sg={};function sw(t,e){return e8(["apply",...e,...t])}t7(sg,{applyPatchTask:()=>sw});var sy=t4({"src/lib/tasks/apply-patch.ts"(){e4()}}),sb=t4({"src/lib/responses/BranchDeleteSummary.ts"(){tB=class{constructor(){this.all=[],this.branches={},this.errors=[]}get success(){return!this.errors.length}}}});function sk(t,e){return 1===e&&tj.test(t)}var sv=t4({"src/lib/parsers/parse-branch-delete.ts"(){sb(),ez(),tj=/^error[^']+'([^']+)'/m,tN=[new w(/(\S+)\s+\(\S+\s([^)]+)\)/,(t,[e,r])=>{let s={branch:e,hash:r,success:!0};t.all.push(s),t.branches[e]=s}),new w(tj,(t,[e])=>{let r={branch:e,hash:null,success:!1};t.errors.push(r),t.all.push(r),t.branches[e]=r})],tI=(t,e)=>eH(new tB,tN,[t,e])}}),sT=t4({"src/lib/responses/BranchSummary.ts"(){tU=class{constructor(){this.all=[],this.branches={},this.current="",this.detached=!1}push(t,e,r,s,i){"*"===t&&(this.detached=e,this.current=r),this.all.push(r),this.branches[r]={current:"*"===t,linkedWorkTree:"+"===t,name:r,commit:s,label:i}}}}});function sR(t){return t?t.charAt(0):""}function s_(t,e=!1){return eH(new tU,e?[tH]:tq,t)}var s$=t4({"src/lib/parsers/parse-branch.ts"(){sT(),ez(),tq=[new w(/^([*+]\s)?\((?:HEAD )?detached (?:from|at) (\S+)\)\s+([a-z0-9]+)\s(.*)$/,(t,[e,r,s,i])=>{t.push(sR(e),!0,r,s,i)}),new w(/^([*+]\s)?(\S+)\s+([a-z0-9]+)\s?(.*)$/s,(t,[e,r,s,i])=>{t.push(sR(e),!1,r,s,i)})],tH=new w(/^(\S+)$/s,(t,[e])=>{t.push("*",!1,e,"","")})}}),sE={};function sS(t){let e=["-d","-D","--delete"];return t.some(t=>e.includes(t))}function sx(t){let e=sS(t),r=t.includes("--show-current"),s=["branch",...t];return 1===s.length&&s.push("-a"),s.includes("-v")||s.splice(1,0,"-v"),{format:"utf-8",commands:s,parser:(t,s)=>e?tI(t,s).all[0]:s_(t,r)}}function sC(){return{format:"utf-8",commands:["branch","-v"],parser:t=>s_(t)}}function sO(t,e=!1){return{format:"utf-8",commands:["branch","-v",e?"-D":"-d",...t],parser:(t,e)=>tI(t,e),onError({exitCode:t,stdOut:e},r,s,i){if(!sk(String(r),t))return i(r);s(e)}}}function sA(t,e=!1){let r={format:"utf-8",commands:["branch","-v",e?"-D":"-d",t],parser:(e,r)=>tI(e,r).branches[t],onError({exitCode:t,stdErr:e,stdOut:s},i,n,o){if(!sk(String(i),t))return o(i);throw new a(r.parser(ev(s),ev(e)),String(i))}};return r}t7(sE,{branchLocalTask:()=>sC,branchTask:()=>sx,containsDeleteBranchCommand:()=>sS,deleteBranchTask:()=>sA,deleteBranchesTask:()=>sO});var sF=t4({"src/lib/tasks/branch.ts"(){es(),sv(),s$(),ez()}});function sL(t){let e=t.trim().replace(/^["']|["']$/g,"");return e&&(0,t0.normalize)(e)}var sD=t4({"src/lib/responses/CheckIgnore.ts"(){tG=t=>t.split(/\n/g).map(sL).filter(Boolean)}}),sP={};function sM(t){return{commands:["check-ignore",...t],format:"utf-8",parser:tG}}t7(sP,{checkIgnoreTask:()=>sM});var sB=t4({"src/lib/tasks/check-ignore.ts"(){sD()}}),sj={};function sN(t){return/^--upload-pack(=|$)/.test(t)}function sI(t,e,r){let s=["clone",...r];return(f(t)&&s.push(t),f(e)&&s.push(e),s.find(sN))?e1("git.fetch: potential exploit argument blocked."):e8(s)}function sU(t,e,r){return ep(r,"--mirror"),sI(t,e,r)}t7(sj,{cloneMirrorTask:()=>sU,cloneTask:()=>sI});var sq=t4({"src/lib/tasks/clone.ts"(){e4(),ez()}});function sH(t,e){return eH({raw:t,remote:null,branches:[],tags:[],updated:[],deleted:[]},tW,[t,e])}var sG=t4({"src/lib/parsers/parse-fetch.ts"(){ez(),tW=[new w(/From (.+)$/,(t,[e])=>{t.remote=e}),new w(/\* \[new branch]\s+(\S+)\s*-> (.+)$/,(t,[e,r])=>{t.branches.push({name:e,tracking:r})}),new w(/\* \[new tag]\s+(\S+)\s*-> (.+)$/,(t,[e,r])=>{t.tags.push({name:e,tracking:r})}),new w(/- \[deleted]\s+\S+\s*-> (.+)$/,(t,[e])=>{t.deleted.push({tracking:e})}),new w(/\s*([^.]+)\.\.(\S+)\s+(\S+)\s*-> (.+)$/,(t,[e,r,s,i])=>{t.updated.push({name:s,tracking:i,to:r,from:e})})]}}),sW={};function sz(t){return/^--upload-pack(=|$)/.test(t)}function sK(t,e,r){let s=["fetch",...r];return(t&&e&&s.push(t,e),s.find(sz))?e1("git.fetch: potential exploit argument blocked."):{commands:s,format:"utf-8",parser:sH}}t7(sW,{fetchTask:()=>sK});var sQ=t4({"src/lib/tasks/fetch.ts"(){sG(),e4()}});function sV(t){return eH({moves:[]},tz,t)}var sX=t4({"src/lib/parsers/parse-move.ts"(){ez(),tz=[new w(/^Renaming (.+) to (.+)$/,(t,[e,r])=>{t.moves.push({from:e,to:r})})]}}),sY={};function sJ(t,e){return{commands:["mv","-v",...eg(t),e],format:"utf-8",parser:sV}}t7(sY,{moveTask:()=>sJ});var sZ=t4({"src/lib/tasks/move.ts"(){sX(),ez()}}),s0={};function s1(t,e,r){let s=["pull",...r];return t&&e&&s.splice(1,0,t,e),{commands:s,format:"utf-8",parser:(t,e)=>tk(t,e),onError(t,e,r,s){var i,n;let o,c=(i=ev(t.stdOut),n=ev(t.stdErr),(o=eH(new tf,tb,[i,n])).message&&o);if(c)return s(new a(c));s(e)}}}t7(s0,{pullTask:()=>s1});var s8=t4({"src/lib/tasks/pull.ts"(){es(),r2(),ez()}});function s2(t){let e={};return s9(t,([t])=>e[t]={name:t}),Object.values(e)}function s3(t){let e={};return s9(t,([t,r,s])=>{Object.hasOwn(e,t)||(e[t]={name:t,refs:{fetch:"",push:""}}),s&&r&&(e[t].refs[s.replace(/[^a-z]/g,"")]=r)}),Object.values(e)}function s9(t,e){eh(t,t=>e(t.split(/\s+/)))}var s4=t4({"src/lib/responses/GetRemoteSummary.ts"(){ez()}}),s7={};function s5(t,e,r){return e8(["remote","add",...r,t,e])}function s6(t){let e=["remote"];return t&&e.push("-v"),{commands:e,format:"utf-8",parser:t?s3:s2}}function it(t){let e=[...t];return"ls-remote"!==e[0]&&e.unshift("ls-remote"),e8(e)}function ie(t){let e=[...t];return"remote"!==e[0]&&e.unshift("remote"),e8(e)}function ir(t){return e8(["remote","remove",t])}t7(s7,{addRemoteTask:()=>s5,getRemotesTask:()=>s6,listRemotesTask:()=>it,remoteTask:()=>ie,removeRemoteTask:()=>ir});var is=t4({"src/lib/tasks/remote.ts"(){s4(),e4()}}),ii={};function ia(t={},e){let r=rQ(t),s=["stash","list",...r.commands,...e],i=rq(r.splitter,r.fields,rM(s));return rz(s)||{commands:s,format:"utf-8",parser:i}}t7(ii,{stashListTask:()=>ia});var io=t4({"src/lib/tasks/stash-list.ts"(){rj(),rH(),rK(),rV()}}),ic={};function iu(t,e){return ih(["add",t,e])}function il(t){return ih(["init",...t])}function ih(t){let e=[...t];return"submodule"!==e[0]&&e.unshift("submodule"),e8(e)}function ip(t){return ih(["update",...t])}t7(ic,{addSubModuleTask:()=>iu,initSubModuleTask:()=>il,subModuleTask:()=>ih,updateSubModuleTask:()=>ip});var im=t4({"src/lib/tasks/sub-module.ts"(){e4()}});function id(t,e){return t===e?0:t>e?1:-1}function ig(t){return t.trim()}function iw(t){return"string"==typeof t&&parseInt(t.replace(/^\D+/g,""),10)||0}var iy=t4({"src/lib/responses/TagList.ts"(){tK=class{constructor(t,e){this.all=t,this.latest=e}},tQ=function(t,e=!1){let r=t.split("\n").map(ig).filter(Boolean);e||r.sort(function(t,e){let r=t.split("."),s=e.split(".");if(1===r.length||1===s.length){var i,a;let t;return i=iw(r[0]),a=iw(s[0]),(t=Number.isNaN(i))!==Number.isNaN(a)?t?1:-1:t?id(i,a):0}for(let t=0,e=Math.max(r.length,s.length);t<e;t++){let e=id(iw(r[t]),iw(s[t]));if(e)return e}return 0});let s=e?r[0]:[...r].reverse().find(t=>t.indexOf(".")>=0);return new tK(r,s)}}}),ib={};function ik(t=[]){let e=t.some(t=>/^--sort=/.test(t));return{format:"utf-8",commands:["tag","-l",...t],parser:t=>tQ(t,e)}}function iv(t){return{format:"utf-8",commands:["tag",t],parser:()=>({name:t})}}function iT(t,e){return{format:"utf-8",commands:["tag","-a","-m",e,t],parser:()=>({name:t})}}t7(ib,{addAnnotatedTagTask:()=>iT,addTagTask:()=>iv,tagListTask:()=>ik});var iR=t4({"src/lib/tasks/tag.ts"(){iy()}}),i_=(e={"src/git.js"(t,e){var{GitExecutor:r}=(rT(),t5(rv)),{SimpleGitApi:s}=(sp(),t5(sf)),{Scheduler:i}=(sd(),t5(sm)),{configurationErrorTask:a}=(e4(),t5(eZ)),{asArray:n,filterArray:o,filterPrimitives:c,filterString:u,filterStringOrStringArray:l,filterType:h,getTrailingOptions:f,trailingFunctionArgument:p,trailingOptionsArgument:m}=(ez(),t5(eW)),{applyPatchTask:d}=(sy(),t5(sg)),{branchTask:g,branchLocalTask:w,deleteBranchesTask:y,deleteBranchTask:b}=(sF(),t5(sE)),{checkIgnoreTask:k}=(sB(),t5(sP)),{checkIsRepoTask:v}=(eY(),t5(eK)),{cloneTask:T,cloneMirrorTask:R}=(sq(),t5(sj)),{cleanWithOptionsTask:_,isCleanOptionsArray:$}=(rr(),t5(e7)),{diffSummaryTask:E}=(rK(),t5(rG)),{fetchTask:S}=(sQ(),t5(sW)),{moveTask:x}=(sZ(),t5(sY)),{pullTask:C}=(s8(),t5(s0)),{pushTagsTask:O}=(se(),t5(r5)),{addRemoteTask:A,getRemotesTask:F,listRemotesTask:L,remoteTask:D,removeRemoteTask:P}=(is(),t5(s7)),{getResetMode:M,resetTask:B}=(rp(),t5(ru)),{stashListTask:j}=(io(),t5(ii)),{addSubModuleTask:N,initSubModuleTask:I,subModuleTask:U,updateSubModuleTask:q}=(im(),t5(ic)),{addAnnotatedTagTask:H,addTagTask:G,tagListTask:W}=(iR(),t5(ib)),{straightThroughBufferTask:z,straightThroughStringTask:K}=(e4(),t5(eZ));function Q(t,e){this._plugins=e,this._executor=new r(t.baseDir,new i(t.maxConcurrentProcesses),e),this._trimmed=t.trimmed}function V(t,e,r,s){return"string"!=typeof r?a(`git.${t}() requires a string 'repoPath'`):e(r,h(s,u),f(arguments))}(Q.prototype=Object.create(s.prototype)).constructor=Q,Q.prototype.customBinary=function(t){return this._plugins.reconfigure("binary",t),this},Q.prototype.env=function(t,e){return 1==arguments.length&&"object"==typeof t?this._executor.env=t:(this._executor.env=this._executor.env||{})[t]=e,this},Q.prototype.stashList=function(t){return this._runTask(j(m(arguments)||{},o(t)&&t||[]),p(arguments))},Q.prototype.clone=function(){return this._runTask(V("clone",T,...arguments),p(arguments))},Q.prototype.mirror=function(){return this._runTask(V("mirror",R,...arguments),p(arguments))},Q.prototype.mv=function(t,e){return this._runTask(x(t,e),p(arguments))},Q.prototype.checkoutLatestTag=function(t){var e=this;return this.pull(function(){e.tags(function(r,s){e.checkout(s.latest,t)})})},Q.prototype.pull=function(t,e,r,s){return this._runTask(C(h(t,u),h(e,u),f(arguments)),p(arguments))},Q.prototype.fetch=function(t,e){return this._runTask(S(h(t,u),h(e,u),f(arguments)),p(arguments))},Q.prototype.silent=function(t){return console.warn("simple-git deprecation notice: git.silent: logging should be configured using the `debug` library / `DEBUG` environment variable, this will be an error in version 3"),this},Q.prototype.tags=function(t,e){return this._runTask(W(f(arguments)),p(arguments))},Q.prototype.rebase=function(){return this._runTask(K(["rebase",...f(arguments)]),p(arguments))},Q.prototype.reset=function(t){return this._runTask(B(M(t),f(arguments)),p(arguments))},Q.prototype.revert=function(t){let e=p(arguments);return"string"!=typeof t?this._runTask(a("Commit must be a string"),e):this._runTask(K(["revert",...f(arguments,0,!0),t]),e)},Q.prototype.addTag=function(t){let e="string"==typeof t?G(t):a("Git.addTag requires a tag name");return this._runTask(e,p(arguments))},Q.prototype.addAnnotatedTag=function(t,e){return this._runTask(H(t,e),p(arguments))},Q.prototype.deleteLocalBranch=function(t,e,r){return this._runTask(b(t,"boolean"==typeof e&&e),p(arguments))},Q.prototype.deleteLocalBranches=function(t,e,r){return this._runTask(y(t,"boolean"==typeof e&&e),p(arguments))},Q.prototype.branch=function(t,e){return this._runTask(g(f(arguments)),p(arguments))},Q.prototype.branchLocal=function(t){return this._runTask(w(),p(arguments))},Q.prototype.raw=function(t){let e=!Array.isArray(t),r=[].slice.call(e?arguments:t,0);for(let t=0;t<r.length&&e;t++)if(!c(r[t])){r.splice(t,r.length-t);break}r.push(...f(arguments,0,!0));var s=p(arguments);return r.length?this._runTask(K(r,this._trimmed),s):this._runTask(a("Raw: must supply one or more command to execute"),s)},Q.prototype.submoduleAdd=function(t,e,r){return this._runTask(N(t,e),p(arguments))},Q.prototype.submoduleUpdate=function(t,e){return this._runTask(q(f(arguments,!0)),p(arguments))},Q.prototype.submoduleInit=function(t,e){return this._runTask(I(f(arguments,!0)),p(arguments))},Q.prototype.subModule=function(t,e){return this._runTask(U(f(arguments)),p(arguments))},Q.prototype.listRemote=function(){return this._runTask(L(f(arguments)),p(arguments))},Q.prototype.addRemote=function(t,e,r){return this._runTask(A(t,e,f(arguments)),p(arguments))},Q.prototype.removeRemote=function(t,e){return this._runTask(P(t),p(arguments))},Q.prototype.getRemotes=function(t,e){return this._runTask(F(!0===t),p(arguments))},Q.prototype.remote=function(t,e){return this._runTask(D(f(arguments)),p(arguments))},Q.prototype.tag=function(t,e){let r=f(arguments);return"tag"!==r[0]&&r.unshift("tag"),this._runTask(K(r),p(arguments))},Q.prototype.updateServerInfo=function(t){return this._runTask(K(["update-server-info"]),p(arguments))},Q.prototype.pushTags=function(t,e){let r=O({remote:h(t,u)},f(arguments));return this._runTask(r,p(arguments))},Q.prototype.rm=function(t){return this._runTask(K(["rm","-f",...n(t)]),p(arguments))},Q.prototype.rmKeepLocal=function(t){return this._runTask(K(["rm","--cached",...n(t)]),p(arguments))},Q.prototype.catFile=function(t,e){return this._catFile("utf-8",arguments)},Q.prototype.binaryCatFile=function(){return this._catFile("buffer",arguments)},Q.prototype._catFile=function(t,e){var r=p(e),s=["cat-file"],i=e[0];if("string"==typeof i)return this._runTask(a("Git.catFile: options must be supplied as an array of strings"),r);Array.isArray(i)&&s.push.apply(s,i);let n="buffer"===t?z(s):K(s);return this._runTask(n,r)},Q.prototype.diff=function(t,e){let r=u(t)?a("git.diff: supplying options as a single string is no longer supported, switch to an array of strings"):K(["diff",...f(arguments)]);return this._runTask(r,p(arguments))},Q.prototype.diffSummary=function(){return this._runTask(E(f(arguments,1)),p(arguments))},Q.prototype.applyPatch=function(t){let e=l(t)?d(n(t),f([].slice.call(arguments,1))):a("git.applyPatch requires one or more string patches as the first argument");return this._runTask(e,p(arguments))},Q.prototype.revparse=function(){let t=["rev-parse",...f(arguments,!0)];return this._runTask(K(t,!0),p(arguments))},Q.prototype.clean=function(t,e,r){let s=$(t),i=s&&t.join("")||h(t,u)||"",a=f([].slice.call(arguments,+!!s));return this._runTask(_(i,a),p(arguments))},Q.prototype.exec=function(t){return this._runTask({commands:[],format:"utf-8",parser(){"function"==typeof t&&t()}})},Q.prototype.clearQueue=function(){return this},Q.prototype.checkIgnore=function(t,e){return this._runTask(k(n(h(t,l,[]))),p(arguments))},Q.prototype.checkIsRepo=function(t,e){return this._runTask(v(h(t,u)),p(arguments))},e.exports=Q}},function(){return r||(0,e[t3(e)[0]])((r={exports:{}}).exports,r),r.exports});ee(),er();var i$=class extends i{constructor(t,e){super(void 0,e),this.config=t}};er(),er();var iE=class extends i{constructor(t,e,r){super(t,r),this.task=t,this.plugin=e,Object.setPrototypeOf(this,new.target.prototype)}};es(),ei(),eY(),rr(),rn(),ro(),rc(),rp(),ez(),ez();var iS=(0,tZ.deferred)().promise;ez();var ix="Invalid value supplied for custom binary, restricted characters must be removed or supply the unsafe.allowUnsafeCustomBinary option";function iC(t){return!t||!/^([a-z]:)?([a-z0-9/.\\_-]+)$/i.test(t)}function iO(t,e){if(t.length<1||t.length>2)throw new iE(void 0,"binary","Invalid value supplied for custom binary, requires a single string or an array containing either one or two strings");if(t.some(iC))if(e)console.warn(ix);else throw new iE(void 0,"binary",ix);let[r,s]=t;return{binary:r,prefix:s}}function iA(t){return{type:"task.error",action(e,r){let s=t(e.error,{stdErr:r.stdErr,stdOut:r.stdOut,exitCode:r.exitCode});return Buffer.isBuffer(s)?{error:new i(void 0,s.toString("utf-8"))}:{error:s}}}}er(),ez();var iF=class{constructor(){this.plugins=new Set,this.events=new t1.EventEmitter}on(t,e){this.events.on(t,e)}reconfigure(t,e){this.events.emit(t,e)}append(t,e){let r=ep(this.plugins,{type:t,action:e});return()=>this.plugins.delete(r)}add(t){let e=[];return eg(t).forEach(t=>t&&this.plugins.add(ep(e,t))),()=>{e.forEach(t=>this.plugins.delete(t))}}exec(t,e,r){let s=e,i=Object.freeze(Object.create(r));for(let e of this.plugins)e.type===t&&(s=e.action(s,i));return s}};ez(),ez(),ee(),ez();var iL=i_();es();var iD=function(t,e){var r;let s,i,a,n,o=new iF,c=eP(t&&("string"==typeof t?{baseDir:t}:t)||{},e);if(!ef(c.baseDir))throw new i$(c,"Cannot use simple-git on a directory that does not exist");return Array.isArray(c.config)&&o.add((s=ek(c.config,"-c"),{type:"spawn.args",action:t=>[...s,...t]})),o.add(function({allowUnsafeProtocolOverride:t=!1,allowUnsafePack:e=!1}={}){return{type:"spawn.args",action:(r,s)=>(r.forEach((i,a)=>{let n=a<r.length?r[a+1]:"";t||function(t,e){if("string"==typeof t&&"-c"===t.trim().toLowerCase()&&/^\s*protocol(.[a-z]+)?.allow/.test(e))throw new iE(void 0,"unsafe","Configuring protocol.allow is not permitted without enabling allowUnsafeExtProtocol")}(i,n),e||function(t,e){if(/^\s*--(upload|receive)-pack/.test(t))throw new iE(void 0,"unsafe","Use of --upload-pack or --receive-pack is not permitted without enabling allowUnsafePack");if("clone"===e&&/^\s*-u\b/.test(t))throw new iE(void 0,"unsafe","Use of clone with option -u is not permitted without enabling allowUnsafePack");if("push"===e&&/^\s*--exec\b/.test(t))throw new iE(void 0,"unsafe","Use of push with option --exec is not permitted without enabling allowUnsafePack")}(i,s.method)}),r)}}(c.unsafe)),o.add({type:"spawn.args",action(t){let e,r=[];function s(t){(e=e||[]).push(...t)}for(let e=0;e<t.length;e++){let i=t[e];if(t6(i)){s(et(i));continue}if("--"===i){s(t.slice(e+1).flatMap(t=>t6(t)&&et(t)||t));break}r.push(i)}return e?[...r,"--",...e.map(String)]:r}}),o.add(function({onClose:t=!0,onExit:e=50}={}){function r(t,e,r){!1!==t&&(!0===t?e.promise:e.promise.then(()=>eR(t))).then(r.done)}return{type:"spawn.after",async action(s,{spawned:i,close:a}){let n,o,c,u=(n=-1,o={close:(0,tZ.deferred)(),closeTimeout:(0,tZ.deferred)(),exit:(0,tZ.deferred)(),exitTimeout:(0,tZ.deferred)()},c=Promise.race([!1===t?iS:o.closeTimeout.promise,!1===e?iS:o.exitTimeout.promise]),r(t,o.close,o.closeTimeout),r(e,o.exit,o.exitTimeout),{close(t){n=t,o.close.done()},exit(t){n=t,o.exit.done()},get exitCode(){return n},result:c}),l=!0,h=()=>void(l=!1);i.stdout?.on("data",h),i.stderr?.on("data",h),i.on("error",h),i.on("close",t=>u.close(t)),i.on("exit",t=>u.exit(t));try{await u.result,l&&await eR(50),a(u.exitCode)}catch(t){a(u.exitCode,t)}}}}(c.completion)),c.abort&&o.add(function(t){if(t)return[{type:"spawn.before",action(e,r){t.aborted&&r.kill(new iE(void 0,"abort","Abort already signaled"))}},{type:"spawn.after",action(e,r){function s(){r.kill(new iE(void 0,"abort","Abort signal received"))}t.addEventListener("abort",s),r.spawned.on("close",()=>t.removeEventListener("abort",s))}}]}(c.abort)),c.progress&&o.add((r=c.progress,i="--progress",a=["checkout","clone","fetch","pull","push"],[{type:"spawn.args",action:(t,e)=>a.includes(e.method)?em(t,i):t},{type:"spawn.after",action(t,e){e.commands.includes(i)&&e.spawned.stderr?.on("data",t=>{let s=/^([\s\S]+?):\s*(\d+)% \((\d+)\/(\d+)\)/.exec(t.toString("utf8"));s&&r({method:e.method,stage:String(s[1].toLowerCase().split(" ",1))||"unknown",progress:eb(s[2]),processed:eb(s[3]),total:eb(s[4])})})}}])),c.timeout&&o.add(function({block:t,stdErr:e=!0,stdOut:r=!0}){if(t>0)return{type:"spawn.after",action(s,i){let a;function n(){a&&clearTimeout(a),a=setTimeout(c,t)}function o(){i.spawned.stdout?.off("data",n),i.spawned.stderr?.off("data",n),i.spawned.off("exit",o),i.spawned.off("close",o),a&&clearTimeout(a)}function c(){o(),i.kill(new iE(void 0,"timeout","block timeout reached"))}r&&i.spawned.stdout?.on("data",n),e&&i.spawned.stderr?.on("data",n),i.spawned.on("exit",o),i.spawned.on("close",o),n()}}}(c.timeout)),c.spawnOptions&&o.add((n=eT(c.spawnOptions,["uid","gid"]),{type:"spawn.options",action:t=>({...n,...t})})),o.add(iA(function(t=!1,e=function(t){return!!(t.exitCode&&t.stdErr.length)},r=function(t){return Buffer.concat([...t.stdOut,...t.stdErr])}){return(s,i)=>(t||!s)&&e(i)?r(i):s}(!0))),c.errors&&o.add(iA(c.errors)),!function(t,e=["git"],r=!1){let s=iO(eg(e),r);t.on("binary",t=>{s=iO(eg(t),r)}),t.append("spawn.binary",()=>s.binary),t.append("spawn.args",t=>s.prefix?[s.prefix,...t]:t)}(o,c.binary,c.unsafe?.allowUnsafeCustomBinary),new iL(c,o)},iP=t.i(74533),iM=t.i(12057),iB=t.i(12714),ij=t.i(60526);let iN=(0,iM.promisify)(iP.execFile),iI={};function iU(t){if(!iI[t]){let e=iD({baseDir:t,binary:"git",maxConcurrentProcesses:6,trimmed:!1});e.env({...process.env,GIT_TERMINAL_PROMPT:"0",GIT_SSH_COMMAND:"ssh -o BatchMode=yes -o StrictHostKeyChecking=no"}),iI[t]=e}return iI[t]}class iq{repoPath;constructor(t){this.repoPath=t}get git(){return iU(this.repoPath)}resolveFilePathWithinRepo(t){let e=(0,t0.resolve)(this.repoPath),r=(0,t0.resolve)(e,t),s=(0,t0.relative)(e,r);if(".."===s||s.startsWith(`..${t0.sep}`)||(0,t0.isAbsolute)(s))throw Error(`File path is outside repository: ${t}`);return r}static async cloneRepository(t,e,r={}){let s=t.trim(),i=e.trim();if(!s)throw Error("Repository URL is required");if(!i)throw Error("Destination path is required");let a=iD({binary:"git",maxConcurrentProcesses:2,trimmed:!1});a.env({...process.env,GIT_TERMINAL_PROMPT:"0",GIT_SSH_COMMAND:"ssh -o BatchMode=yes -o StrictHostKeyChecking=no"});let n=r.credentials?function(t,e){let r=function(t){if(t.startsWith("http://")||t.startsWith("https://"))return t;let e=t.match(/^git@([^:]+):(.+)$/);return e?`https://${e[1]}/${e[2]}`:null}(t);if(!r)return t;let s=new URL(r);return s.username=e.username,s.password=e.token,s.toString()}(s,r.credentials):s;if(await a.clone(n,i),n!==s){let t=iU(i);await t.raw(["remote","set-url","origin",s])}}static async initializeRepository(t){let e=t.trim();if(!e)throw Error("Path is required");let r=iD({baseDir:e,binary:"git",maxConcurrentProcesses:2,trimmed:!1});await r.init()}async cleanupLockFile(){let t=(0,t0.join)(this.repoPath,".git","index.lock");try{return await (0,iB.unlink)(t),!0}catch(t){return!1}}async getStatus(){return await this.git.status()}async hasRef(t){try{return await this.git.revparse(["--verify",t]),!0}catch{return!1}}async gitPathExists(t){try{let e=(await this.git.raw(["rev-parse","--git-path",t])).trim();if(!e)return!1;return await (0,iB.access)(e),!0}catch{return!1}}async getConflictState(){let t=(await this.git.status()).conflicted??[],e=t.length>0,[r,s,i,a]=await Promise.all([this.hasRef("MERGE_HEAD"),this.hasRef("REBASE_HEAD"),this.gitPathExists("rebase-apply"),this.gitPathExists("rebase-merge")]),n=null;return s||i||a?n="rebase":r&&(n="merge"),{operation:n,conflictedFiles:t,hasConflicts:e,canContinue:!!n&&!e}}async getLog(t=100){let e=await this.git.log({"--all":null,"--decorate":"short","--max-count":t,format:{hash:"%h",parents:"%p",date:"%ai",message:"%s",refs:"%d",author_name:"%an",author_email:"%ae",body:"%b"}}),r=e.all.map(t=>({...t,parents:t.parents?t.parents.split(" ").filter(Boolean):[]}));return{all:r,total:e.total,latest:r[0]||null}}async getLatestCommitMessage(t){return(await this.git.raw(["show","-s","--format=%B",t])).trimEnd()}async fetch(){await this.git.raw(["fetch","--prune"])}async fetchRemote(t){await this.git.raw(["fetch","--prune",t])}async fetchAllRemotes(){await this.git.raw(["fetch","--all","--prune"])}async addRemote(t,e){let r=t.trim(),s=e.trim();if(!r)throw Error("Remote name is required");if(!s)throw Error("Remote URL is required");await this.git.raw(["remote","add",r,s]),await this.git.raw(["fetch","--prune",r])}async renameRemote(t,e){let r=t.trim(),s=e.trim();if(!r)throw Error("Old remote name is required");if(!s)throw Error("New remote name is required");r!==s&&await this.git.raw(["remote","rename",r,s])}async deleteRemote(t){let e=t.trim();if(!e)throw Error("Remote name is required to delete remote");await this.git.raw(["remote","remove",e])}async pull(){await this.git.pull()}async push(t={}){let{credentials:e}=t;if(e){let t=(await this.git.branchLocal()).current,r=await this.getTrackingBranch(t);if(!r)throw Error(`No upstream configured for branch '${t}'. Cannot push with credentials.`);await this.pushToRemote(t,r.remote,r.branch,{credentials:e})}else await this.git.push()}async hasHeadCommit(){try{return await this.git.revparse(["--verify","HEAD"]),!0}catch{return!1}}async validateBranchName(t){await this.git.raw(["check-ref-format","--branch",t])}async ensureInitialBranchForFirstCommit(t){if(!t||await this.hasHeadCommit())return;let e=t.trim();if(!e)throw Error("Initial branch name is required for first commit");await this.validateBranchName(e),await this.git.raw(["symbolic-ref","HEAD",`refs/heads/${e}`])}async commit(t,e,r={}){await this.ensureInitialBranchForFirstCommit(r.initialBranch),e&&e.length>0&&await this.git.add(e),await this.git.commit(t)}async stage(t){await this.git.add(t)}async unstage(t){await this.git.reset(["HEAD",...t])}async discardUnstagedChanges(t={}){let{includeUntracked:e=!0}=t;await this.git.raw(["checkout","--","."]),e&&await this.git.raw(["clean","-fd"])}async getFileContent(t,e="HEAD"){if("HEAD"===e&&!await this.hasHeadCommit())return"";try{return await this.git.show([`${e}:${t}`])}catch(t){return console.error(t),""}}async getBlobFromRef(t){try{let{stdout:e}=await iN("git",["show",t],{cwd:this.repoPath,encoding:"buffer",maxBuffer:0x3200000});return Buffer.isBuffer(e)?e:Buffer.from(e)}catch{return null}}async getFileContentBuffer(t,e="HEAD"){return"HEAD"!==e||await this.hasHeadCommit()?this.getBlobFromRef(`${e}:${t}`):null}async getConflictFileVersions(t){let[e,r]=await Promise.all([this.getBlobFromRef(`:2:${t}`),this.getBlobFromRef(`:3:${t}`)]),s="";try{let e=this.resolveFilePathWithinRepo(t);s=await (0,iB.readFile)(e,"utf-8")}catch{s=""}return{ours:e?e.toString("utf-8"):"",theirs:r?r.toString("utf-8"):"",current:s}}async resolveConflictFile(t,e,r={}){let{content:s,stage:i=!0}=r;if("ours"===e||"theirs"===e)await this.git.raw(["checkout",`--${e}`,"--",t]);else{if("string"!=typeof s)throw Error("Content is required for manual conflict resolution");let e=this.resolveFilePathWithinRepo(t);await (0,iB.writeFile)(e,s,"utf-8")}i&&await this.git.add([t])}async getDiff(t){if(!await this.hasHeadCommit()){let[e,r]=await Promise.all([this.git.diff(["--cached","--",t]),this.git.diff(["--",t])]);return[e,r].filter(Boolean).join("\n")}return await this.git.diff(["HEAD","--",t])}parseWorktreeEntries(t){let e=[],r=null;for(let s of t.split("\n")){if(s.startsWith("worktree ")){r&&e.push(r),r={path:s.slice(9).trim(),branch:null,head:null,detached:!1};continue}if(r){if(s.startsWith("branch ")){let t=s.slice(7).trim();r.branch=t.startsWith("refs/heads/")?t.slice(11):t||null;continue}if(s.startsWith("HEAD ")){r.head=s.slice(5).trim()||null;continue}"detached"===s&&(r.detached=!0)}}r&&e.push(r);let s=(0,t0.resolve)(this.repoPath),i=new Map;for(let t of e){let e=(0,t0.resolve)(t.path);i.has(e)||i.set(e,{path:t.path,branch:t.detached?null:t.branch,head:t.head,isCurrent:e===s})}return Array.from(i.values()).sort((t,e)=>t.isCurrent&&!e.isCurrent?-1:!t.isCurrent&&e.isCurrent?1:t.path.localeCompare(e.path))}async getWorktrees(t){try{let t=await this.git.raw(["worktree","list","--porcelain"]),e=this.parseWorktreeEntries(t);if(e.length>0)return e}catch(t){console.warn("Failed to list git worktrees:",t)}return[{path:this.repoPath,branch:t||null,head:null,isCurrent:!0}]}async getBranches(){let t="";try{t=(await this.git.revparse(["--abbrev-ref","HEAD"])).trim()}catch(t){console.warn("Failed to get current branch:",t)}let e="";try{e=await this.git.raw(["for-each-ref","--format=%(refname)|%(objectname:short)|%(upstream:short)|%(upstream:track)","refs/heads","refs/remotes"])}catch(t){throw console.error("Failed to get refs:",t),t}let r=[],s={},i={},a={};for(let t of e.trim().split("\n")){if(!t)continue;let[e,n,o,c]=t.split("|");if(e.startsWith("refs/heads/")){let t=e.slice(11);if(r.push(t),s[t]=n,o){let e=0,r=0;if(c){let t=c.match(/ahead (\d+)/);t&&(e=parseInt(t[1],10));let s=c.match(/behind (\d+)/);s&&(r=parseInt(s[1],10))}a[t]={upstream:o,ahead:e,behind:r}}}else if(e.startsWith("refs/remotes/")){let t=e.slice(13),r=t.indexOf("/");if(r>0){let e=t.slice(0,r),a=t.slice(r+1);if("HEAD"===a||a.startsWith("HEAD "))continue;i[e]||(i[e]=[]),i[e].push(a),s[`remotes/${t}`]=n}}}let n=await this.git.getRemotes(!0),o={};for(let t of n)o[t.name]=t.refs.fetch||t.refs.push,i[t.name]||(i[t.name]=[]);let c=await this.getWorktrees(t);return{branches:r,current:t,branchCommits:s,remotes:i,remoteUrls:o,trackingInfo:a,worktrees:c}}async checkout(t){await this.git.checkout(t)}async checkoutRemoteToLocal(t,e){try{await this.git.revparse(["--verify",`refs/${t}`])}catch{throw Error(`Remote branch '${t}' does not exist`)}try{throw await this.git.revparse(["--verify",`refs/heads/${e}`]),Error(`Local branch '${e}' already exists`)}catch(t){if(t.message.includes("already exists"))throw t}let r=t.replace(/^remotes\//,""),s=r.indexOf("/");if(s<=0)throw Error(`Invalid remote branch format: ${t}`);let i=r.slice(0,s),a=r.slice(s+1);await this.git.checkout(["-b",e,"--track",`${i}/${a}`])}async createBranch(t,e){if(!e)return void await this.git.checkoutLocalBranch(t);let r=e.startsWith("remotes/")?e.replace(/^remotes\//,""):e;await this.git.checkout(["-b",t,r])}async createTag(t,e,r={}){let{pushToRemote:s=!1,remote:i,credentials:a}=r,n=t.trim(),o=e.trim();if(!n)throw Error("Tag name is required");if(!o)throw Error("Commit hash is required");if(await this.git.raw(["tag",n,o]),!s)return;let c=await this.git.getRemotes();if(0===c.length)throw Error("No remotes configured for this repository");let u=i?.trim()||"";if(!u){let t=(await this.git.branchLocal()).current;if(t){let e=await this.getTrackingBranch(t);e?.remote&&(u=e.remote)}}u&&c.some(t=>t.name===u)||(u=c.some(t=>"origin"===t.name)?"origin":c[0].name);let l=u;if(a){let t=await this.getRemoteUrl(u);if(t)try{let e=new URL(t);e.username=a.username,e.password=a.token,l=e.toString()}catch(t){console.warn("[createTag] Failed to construct authenticated URL, falling back to remote name",t)}else console.warn(`[createTag] Could not resolve URL for remote '${u}', falling back to remote name`)}await this.git.push([l,`refs/tags/${n}`])}async deleteBranch(t){await this.git.deleteLocalBranch(t,!0)}async deleteWorktree(t){let e=t.trim();if(!e)throw Error("Worktree path is required");let r=(0,t0.resolve)(e);if(r===(0,t0.resolve)(this.repoPath))throw Error("Cannot delete the current worktree");if(!(await this.getWorktrees("")).some(t=>(0,t0.resolve)(t.path)===r))throw Error(`Worktree not found: ${e}`);await this.git.raw(["worktree","remove",e]),await this.git.raw(["worktree","prune"])}async deleteRemoteBranch(t,e,r){let s=t;if(r){let e=await this.getRemoteUrl(t);if(e)try{let t=new URL(e);t.username=r.username,t.password=r.token,s=t.toString()}catch(t){console.warn("[deleteRemoteBranch] Failed to construct authenticated URL, falling back to remote name",t)}else console.warn(`[deleteRemoteBranch] Could not resolve URL for remote '${t}', falling back to remote name`)}try{await this.git.push([s,"--delete",e])}catch(r){if((r?.message||"").includes("remote ref does not exist"))console.debug(`[deleteRemoteBranch] Remote branch ${e} does not exist on remote ${t}, ignoring error.`);else throw r}try{await this.git.branch(["-r","-D",`${t}/${e}`])}catch(r){console.debug(`[deleteRemoteBranch] Could not delete local remote-tracking branch ${t}/${e}:`,r)}}async deleteTag(t){await this.git.raw(["tag","-d",t])}async deleteRemoteTag(t,e,r){let s=t;if(r){let e=await this.getRemoteUrl(t);if(e)try{let t=new URL(e);t.username=r.username,t.password=r.token,s=t.toString()}catch(t){console.warn("[deleteRemoteTag] Failed to construct authenticated URL, falling back to remote name",t)}else console.warn(`[deleteRemoteTag] Could not resolve URL for remote '${t}', falling back to remote name`)}await this.git.push([s,"--delete",`refs/tags/${e}`])}async renameBranch(t,e,r={}){let{renameTrackingRemote:s=!1,credentials:i}=r,a=s?await this.getTrackingBranch(t):null;if(await this.git.branch(["-m",t,e]),s&&a){await this.renameRemoteBranch(a.remote,a.branch,e,i);try{await this.git.branch(["--set-upstream-to",`${a.remote}/${e}`,e])}catch(t){console.debug(`[renameBranch] Could not set upstream for ${e} to ${a.remote}/${e}:`,t)}}}async renameRemoteBranch(t,e,r,s){if(e===r)return;let i=t;if(s){let e=await this.getRemoteUrl(t);if(e)try{let t=new URL(e);t.username=s.username,t.password=s.token,i=t.toString()}catch(t){console.warn("[renameRemoteBranch] Failed to construct authenticated URL, falling back to remote name",t)}else console.warn(`[renameRemoteBranch] Could not resolve URL for remote '${t}', falling back to remote name`)}let a=`refs/remotes/${t}/${e}`;await this.git.push([i,`${a}:refs/heads/${r}`]),await this.git.push([i,"--delete",e]);let n=`refs/remotes/${t}/${r}`;try{let t=(await this.git.revparse([a])).trim();await this.git.raw(["update-ref",n,t])}catch(t){console.debug(`[renameRemoteBranch] Could not update local tracking ref ${n}:`,t)}try{await this.git.branch(["-r","-D",`${t}/${e}`])}catch(r){console.debug(`[renameRemoteBranch] Could not delete old local remote-tracking branch ${t}/${e}:`,r)}}async reset(t,e="hard"){await this.git.reset([`--${e}`,t])}async revert(t){await this.git.raw(["revert","--no-edit",t])}async cherryPick(t){await this.git.raw(["cherry-pick",t])}async cherryPickMultiple(t){0!==t.length&&await this.git.raw(["cherry-pick",...t])}async abortCherryPick(){await this.git.raw(["cherry-pick","--abort"])}async continueMerge(){await this.git.raw(["merge","--continue"])}async abortMerge(){await this.git.raw(["merge","--abort"])}async continueRebase(){await this.git.raw(["rebase","--continue"])}async abortRebase(){await this.git.raw(["rebase","--abort"])}async rebase(t,e=!0){if(e){let e=(await this.git.status()).files.length>0;e&&await this.git.stash(["push","-m","auto-stash before rebase"]);try{await this.git.rebase([t]),e&&await this.git.stash(["pop"])}catch(t){if(e)try{await this.git.stash(["pop"])}catch{}throw t}}else await this.git.reset(["--hard","HEAD"]),await this.git.rebase([t])}async reword(t,e,r){let s=(await this.git.branchLocal()).current,i=r||s,a=i!==s,n=(await this.git.status()).files.length>0;n&&await this.git.stash(["push","-m","auto-stash before reword"]),a&&await this.git.checkout(i);try{let r=await this.git.revparse(["HEAD"]),o=await this.git.revparse([t]);if(r.trim()!==o.trim())throw Error(`Commit ${t} is not the latest commit on branch ${i}. Only the latest commit can be reworded.`);if(await this.git.raw(["commit","--amend","-m",e]),a&&await this.git.checkout(s),n)try{await this.git.stash(["pop"])}catch{console.warn("Failed to pop stash after reword")}}catch(t){if(a)try{await this.git.checkout(s)}catch{}if(n)try{await this.git.stash(["pop"])}catch{}throw t}}parseNameStatusDiff(t){return t.trim().split("\n").filter(Boolean).map(t=>{let[e,...r]=t.split(" ");return{path:r.length>1?r[r.length-1]:r[0]??"",status:e,additions:0,deletions:0}})}async getCommitRangeRefs(t,e){let r=t.trim(),s=e.trim();if(!r||!s)throw Error("Both oldest and latest commit hashes are required");return{fromRef:r,toRef:s}}async getCommitDiff(t){let e=await this.git.raw(["diff-tree","-m","--first-parent","--no-commit-id","--name-status","-r",t]);return{files:this.parseNameStatusDiff(e),diff:await this.git.raw(["show","-m","--first-parent","--format=",t])}}async getCommitRangeDiff(t,e){let{fromRef:r,toRef:s}=await this.getCommitRangeRefs(t,e),i=await this.git.raw(["diff","--name-status",r,s]);return{files:this.parseNameStatusDiff(i),diff:await this.git.raw(["diff",r,s])}}async getCommitFileDiff(t,e){let r="",s="";try{r=await this.git.show([`${t}^:${e}`])}catch{r=""}try{s=await this.git.show([`${t}:${e}`])}catch{s=""}return{before:r,after:s,diff:await this.getCommitFilePatch(t,e)}}async getCommitRangeFileDiff(t,e,r){let{fromRef:s,toRef:i}=await this.getCommitRangeRefs(t,e),a="",n="";try{a=await this.git.show([`${s}:${r}`])}catch{a=""}try{n=await this.git.show([`${i}:${r}`])}catch{n=""}return{before:a,after:n,diff:await this.getCommitRangeFilePatch(t,e,r)}}async getCommitFilePatch(t,e){try{return await this.git.raw(["show","--format=",t,"--",e])}catch(t){return console.warn("Failed to get commit file diff:",t),""}}async getCommitRangeFilePatch(t,e,r){try{let{fromRef:s,toRef:i}=await this.getCommitRangeRefs(t,e);return await this.git.raw(["diff",s,i,"--",r])}catch(t){return console.warn("Failed to get commit range file diff:",t),""}}async willMergeHaveConflicts(t,e){let r=await this.git.branchLocal(),s=e||r.current;if(!s)throw Error("Could not determine target branch for merge conflict check");if(t===s)return!1;await this.git.revparse(["--verify",t]),await this.git.revparse(["--verify",s]);let i=t=>{let e=t.toLowerCase();return!!(e.includes("conflict")||e.includes("changed in both")||e.includes("added in both")||e.includes("removed in both")||t.includes("<<<<<<<"))||/^[0-9]{6}\s+[0-9a-f]{40,64}\s+[123]\t/m.test(t)};try{let e=await this.git.raw(["merge-tree","--write-tree",s,t]);return i(e)}catch(r){let t=`${r.message??""}
2
- ${r.stdout??""}
3
- ${r.stderr??""}`,e=t.toLowerCase();if(i(t)||!(e.includes("unknown option")||e.includes("usage: git merge-tree")))return!0}let a=(await this.git.raw(["merge-base",s,t])).trim(),n=await this.git.raw(["merge-tree",a,s,t]),o=n.toLowerCase();return n.includes("<<<<<<<")||o.includes("changed in both")||o.includes("added in both")||o.includes("removed in both")||o.includes("conflict")}async willRebaseHaveConflicts(t,e){let r=await this.git.branchLocal(),s=e||r.current;if(!s)throw Error("Could not determine source branch for rebase conflict check");if(s===t)return!1;await this.git.revparse(["--verify",s]),await this.git.revparse(["--verify",t]);let i=await (0,iB.mkdtemp)((0,t0.join)((0,ij.tmpdir)(),"git-web-rebase-check-")),a=!1;try{await this.git.raw(["worktree","add","--detach",i,s]),a=!0;let e=iD({baseDir:i,binary:"git",maxConcurrentProcesses:2,trimmed:!1});return e.env({...process.env,GIT_TERMINAL_PROMPT:"0",GIT_SSH_COMMAND:"ssh -o BatchMode=yes -o StrictHostKeyChecking=no"}),await e.rebase([t]),!1}catch(e){let t=`${e.message??""}
4
- ${e.stdout??""}
5
- ${e.stderr??""}`.toLowerCase();if(t.includes("conflict")||t.includes("could not apply"))return!0;throw e}finally{if(a)try{await this.git.raw(["worktree","remove","--force",i])}catch(t){console.debug(`[willRebaseHaveConflicts] Failed to remove temp worktree ${i}:`,t)}}}async merge(t,e={}){let{rebaseBeforeMerge:r,squash:s,fastForward:i,squashMessage:a}=e,n=(await this.git.branchLocal()).current;r&&(await this.git.checkout(t),await this.git.rebase([n]),await this.git.checkout(n));let o=[];if(s&&o.push("--squash"),i?o.push("--ff-only"):s||o.push("--no-ff"),o.push(t),await this.git.merge(o),s){let e=a||`Squash merge branch '${t}'`;await this.git.commit(e)}}async getRemotes(){return(await this.git.getRemotes()).map(t=>t.name)}async getRemoteBranches(t){await this.git.fetch(t);let e=await this.git.branch(["-r"]),r=[];for(let s of e.all)if(s.startsWith(`${t}/`)){let e=s.slice(`${t}/`.length);if("HEAD"===e||e.startsWith("HEAD "))continue;r.push(e)}return r}async getTrackingBranch(t){try{let e=(await this.git.raw(["for-each-ref","--format=%(upstream:short)",`refs/heads/${t}`])).trim();if(e){let t=e.indexOf("/");if(t>0)return{remote:e.slice(0,t),branch:e.slice(t+1)}}return null}catch{return null}}async pullFromRemote(t,e,r,s={}){let{rebase:i=!0}=s;console.log("[pullFromRemote] Starting pull:",{localBranch:t,remote:e,remoteBranch:r,options:s});let a=(await this.git.branchLocal()).current,n=t!==a;console.log("[pullFromRemote] Fetching from remote:",e),await this.git.fetch(e),console.log("[pullFromRemote] Fetch completed");let o=`${e}/${r}`;try{await this.git.revparse(["--verify",`refs/remotes/${o}`]),console.log("[pullFromRemote] Remote branch exists:",o)}catch{throw Error(`Remote branch '${o}' does not exist`)}let c=(await this.git.status()).files.length>0;console.log("[pullFromRemote] Has uncommitted changes:",c),c&&(console.log("[pullFromRemote] Stashing changes..."),await this.git.stash(["push","-m","auto-stash before pull"])),n&&(console.log(`[pullFromRemote] Checking out branch ${t}...`),await this.git.checkout(t));try{if(i?(console.log("[pullFromRemote] Rebasing onto:",o),await this.git.rebase([o]),console.log("[pullFromRemote] Rebase completed")):(console.log("[pullFromRemote] Merging:",o),await this.git.merge([o]),console.log("[pullFromRemote] Merge completed")),n&&(console.log(`[pullFromRemote] Returning to original branch ${a}...`),await this.git.checkout(a)),c)try{console.log("[pullFromRemote] Popping stashed changes..."),await this.git.stash(["pop"])}catch{throw Error('Pull succeeded but failed to restore local changes. Run "git stash pop" manually.')}console.log("[pullFromRemote] Refreshing remote refs after pull:",e),await this.git.fetch(e),console.log("[pullFromRemote] Post-pull fetch completed"),console.log("[pullFromRemote] Operation completed successfully")}catch(t){if(console.error("[pullFromRemote] Error:",t),!(t.message?.toLowerCase().includes("conflict")||t.stdout?.toLowerCase().includes("conflict")||t.stderr?.toLowerCase().includes("conflict"))){try{i?await this.git.rebase(["--abort"]):await this.git.merge(["--abort"])}catch{}if(n)try{await this.git.checkout(a)}catch{}if(c)try{await this.git.stash(["pop"])}catch{}}throw t}}async getRemoteUrl(t){try{let e=(await this.git.getRemotes(!0)).find(e=>e.name===t);return e?e.refs.push||e.refs.fetch:null}catch{return null}}async stash(t){let e=["push","--include-untracked"];t&&e.push("-m",t),await this.git.stash(e)}async getStashes(){try{let t=await this.git.raw(["stash","list","--format=%gd|%s|%ai|%H"]);if(!t.trim())return[];return t.trim().split("\n").map((t,e)=>{let[r,s,i,a]=t.split("|"),n=r.match(/stash@\{(\d+)\}/);return{index:n?parseInt(n[1],10):e,message:s||"No message",date:i,hash:a}})}catch{return[]}}async applyStash(t){await this.git.stash(["apply",`stash@{${t}}`])}async dropStash(t){await this.git.stash(["drop",`stash@{${t}}`])}async popStash(t){await this.git.stash(["pop",`stash@{${t}}`])}async getStashFiles(t){try{let e=await this.git.raw(["stash","show","--name-status",`stash@{${t}}`]);if(!e.trim())return[];return e.trim().split("\n").map(t=>{let[e,...r]=t.split(" ");return{path:r.join(" "),status:e}})}catch{return[]}}async getStashFileDiff(t,e){let r="",s="";try{r=await this.git.show([`stash@{${t}}^1:${e}`])}catch{r=""}try{s=await this.git.show([`stash@{${t}}:${e}`])}catch{s=""}return{left:r,right:s,diff:await this.getStashFilePatch(t,e)}}async getStashFilePatch(t,e){try{return await this.git.raw(["stash","show","-p",`stash@{${t}}`,"--",e])}catch(t){return console.warn("Failed to get stash file diff:",t),""}}async getRemoteTagNames(t){let e=await this.git.raw(["ls-remote","--tags",t]),r=new Set;for(let t of e.split("\n")){let e=t.trim();if(!e)continue;let s=e.split(" ");if(s.length<2)continue;let i=s[1];i.startsWith("refs/tags/")&&(i.endsWith("^{}")||r.add(i.slice(10)))}return r}async pushLocalOnlyTagsToRemote(t,e){let r=(await this.git.tags()).all;if(0===r.length)return 0;let s=await this.getRemoteTagNames(e),i=r.filter(t=>!s.has(t));if(0===i.length)return 0;let a=i.map(t=>`refs/tags/${t}`);return await this.git.push([t,...a]),i.length}async pushToRemote(t,e,r,s={}){let{rebaseFirst:i,forcePush:a,pushLocalOnlyTags:n,setUpstream:o,squash:c,squashMessage:u,credentials:l}=s,h={...s};h.credentials&&(h.credentials={...h.credentials,token:"***"}),console.log("[pushToRemote] Starting push:",{localBranch:t,remote:e,remoteBranch:r,options:h});let f=(await this.git.branchLocal()).current,p=t!==f,m=(await this.git.status()).files.length>0;console.log("[pushToRemote] Has uncommitted changes:",m),m&&(console.log("[pushToRemote] Stashing changes..."),await this.git.stash(["push","-m","auto-stash before push"])),p&&(console.log(`[pushToRemote] Checking out branch ${t}...`),await this.git.checkout(t));try{let s=e;if(l){let t=await this.getRemoteUrl(e);if(t)try{let e=new URL(t);e.username=l.username,e.password=l.token,s=e.toString(),console.log("[pushToRemote] Using authenticated URL for push")}catch(t){console.warn("[pushToRemote] Failed to construct authenticated URL, falling back to remote name",t)}else console.warn(`[pushToRemote] Could not resolve URL for remote '${e}', falling back to remote name`)}console.log("[pushToRemote] Fetching from remote:",e),await this.git.fetch(s),console.log("[pushToRemote] Fetch completed");let h=`${e}/${r}`,d=!1;try{await this.git.revparse(["--verify",`refs/remotes/${h}`]),d=!0,console.log("[pushToRemote] Remote branch exists:",h)}catch{d=!1,console.log("[pushToRemote] Remote branch does not exist:",h)}if(d&&!a){if(i?(console.log("[pushToRemote] Rebasing onto:",h),await this.git.rebase([h]),console.log("[pushToRemote] Rebase completed")):(console.log("[pushToRemote] Merging:",h),await this.git.merge([h]),console.log("[pushToRemote] Merge completed")),c){console.log("[pushToRemote] Squashing commits onto:",h),await this.git.reset(["--soft",h]);let t=u||`Squash commits before push to ${r}`;await this.git.commit(t),console.log("[pushToRemote] Squash completed")}}else d&&a?console.log("[pushToRemote] Force push requested; skipping pre-push rebase/merge to avoid preserving remote history"):c&&console.warn("[pushToRemote] Cannot squash: remote branch does not exist");let g=[];a&&g.push("--force"),g.push("--progress"),console.log("[pushToRemote] Pushing to",e,"with refspec",`${t}:${r}`,"options:",g);let w=await this.git.push(s,`${t}:${r}`,g);if(console.log("[pushToRemote] Push completed successfully, result:",w),o&&(await this.git.raw(["config",`branch.${t}.remote`,e]),await this.git.raw(["config",`branch.${t}.merge`,`refs/heads/${r}`])),n??!0){let t=await this.pushLocalOnlyTagsToRemote(s,e);console.log(`[pushToRemote] Pushed ${t} local-only tag(s) to ${e}`)}if(p&&(console.log(`[pushToRemote] Returning to original branch ${f}...`),await this.git.checkout(f)),m)try{console.log("[pushToRemote] Popping stashed changes..."),await this.git.stash(["pop"])}catch{throw Error('Push succeeded but failed to restore local changes. Run "git stash pop" manually.')}console.log("[pushToRemote] Operation completed successfully")}catch(t){if(console.error("[pushToRemote] Error:",t),!(t.message?.toLowerCase().includes("conflict")||t.stdout?.toLowerCase().includes("conflict")||t.stderr?.toLowerCase().includes("conflict"))){if(p)try{await this.git.checkout(f)}catch{}if(m)try{await this.git.stash(["pop"])}catch{}}throw t}}}t.s(["GitService",()=>iq],87140)}];
6
-
7
- //# sourceMappingURL=%5Broot-of-the-server%5D__b17e6c62._.js.map