@statewalker/vcs-commands 0.5.0 → 0.7.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 (561) hide show
  1. package/README.md +123 -8
  2. package/dist/commands/add-command.d.ts +265 -34
  3. package/dist/commands/add-command.d.ts.map +1 -1
  4. package/dist/commands/add-patch/add-interactive.d.ts +46 -0
  5. package/dist/commands/add-patch/add-interactive.d.ts.map +1 -0
  6. package/dist/commands/add-patch/add-patch.d.ts +139 -0
  7. package/dist/commands/add-patch/add-patch.d.ts.map +1 -0
  8. package/dist/commands/add-patch/index.d.ts +6 -0
  9. package/dist/commands/add-patch/index.d.ts.map +1 -0
  10. package/dist/commands/add-patch/patch-backend.d.ts +80 -0
  11. package/dist/commands/add-patch/patch-backend.d.ts.map +1 -0
  12. package/dist/commands/add-patch/patch-modes.d.ts +71 -0
  13. package/dist/commands/add-patch/patch-modes.d.ts.map +1 -0
  14. package/dist/commands/add-patch/patch-session.d.ts +49 -0
  15. package/dist/commands/add-patch/patch-session.d.ts.map +1 -0
  16. package/dist/commands/am/am-command.d.ts +175 -0
  17. package/dist/commands/am/am-command.d.ts.map +1 -0
  18. package/dist/commands/am/index.d.ts +3 -0
  19. package/dist/commands/am/index.d.ts.map +1 -0
  20. package/dist/commands/am/mailinfo.d.ts +58 -0
  21. package/dist/commands/am/mailinfo.d.ts.map +1 -0
  22. package/dist/commands/am/patch-format.d.ts +24 -0
  23. package/dist/commands/am/patch-format.d.ts.map +1 -0
  24. package/dist/commands/apply/apply-command.d.ts +153 -0
  25. package/dist/commands/apply/apply-command.d.ts.map +1 -0
  26. package/dist/commands/apply/apply-engine.d.ts +195 -0
  27. package/dist/commands/apply/apply-engine.d.ts.map +1 -0
  28. package/dist/commands/apply/apply-parse.d.ts +86 -0
  29. package/dist/commands/apply/apply-parse.d.ts.map +1 -0
  30. package/dist/commands/apply/apply-types.d.ts +70 -0
  31. package/dist/commands/apply/apply-types.d.ts.map +1 -0
  32. package/dist/commands/apply/index.d.ts +6 -0
  33. package/dist/commands/apply/index.d.ts.map +1 -0
  34. package/dist/commands/apply/latin1.d.ts +32 -0
  35. package/dist/commands/apply/latin1.d.ts.map +1 -0
  36. package/dist/commands/apply/whitespace.d.ts +58 -0
  37. package/dist/commands/apply/whitespace.d.ts.map +1 -0
  38. package/dist/commands/attributes-source.d.ts +26 -0
  39. package/dist/commands/attributes-source.d.ts.map +1 -0
  40. package/dist/commands/backfill-command.d.ts +110 -0
  41. package/dist/commands/backfill-command.d.ts.map +1 -0
  42. package/dist/commands/bisect/bisect-checkout.d.ts +64 -0
  43. package/dist/commands/bisect/bisect-checkout.d.ts.map +1 -0
  44. package/dist/commands/bisect/bisect-command.d.ts +201 -0
  45. package/dist/commands/bisect/bisect-command.d.ts.map +1 -0
  46. package/dist/commands/bisect/bisect-engine.d.ts +219 -0
  47. package/dist/commands/bisect/bisect-engine.d.ts.map +1 -0
  48. package/dist/commands/bisect/bisect-graph.d.ts +127 -0
  49. package/dist/commands/bisect/bisect-graph.d.ts.map +1 -0
  50. package/dist/commands/bisect/bisect-quote.d.ts +27 -0
  51. package/dist/commands/bisect/bisect-quote.d.ts.map +1 -0
  52. package/dist/commands/bisect/index.d.ts +5 -0
  53. package/dist/commands/bisect/index.d.ts.map +1 -0
  54. package/dist/commands/blame-command.d.ts +122 -131
  55. package/dist/commands/blame-command.d.ts.map +1 -1
  56. package/dist/commands/branch-command.d.ts +52 -2
  57. package/dist/commands/branch-command.d.ts.map +1 -1
  58. package/dist/commands/branch-tracking.d.ts +98 -0
  59. package/dist/commands/branch-tracking.d.ts.map +1 -0
  60. package/dist/commands/checkout-command.d.ts +300 -18
  61. package/dist/commands/checkout-command.d.ts.map +1 -1
  62. package/dist/commands/checkout-paths.d.ts +124 -0
  63. package/dist/commands/checkout-paths.d.ts.map +1 -0
  64. package/dist/commands/cherry-pick-command.d.ts +50 -42
  65. package/dist/commands/cherry-pick-command.d.ts.map +1 -1
  66. package/dist/commands/clean-command.d.ts +49 -16
  67. package/dist/commands/clean-command.d.ts.map +1 -1
  68. package/dist/commands/clone-command.d.ts +134 -0
  69. package/dist/commands/clone-command.d.ts.map +1 -1
  70. package/dist/commands/comment-char-config.d.ts +35 -0
  71. package/dist/commands/comment-char-config.d.ts.map +1 -0
  72. package/dist/commands/commit-command.d.ts +311 -17
  73. package/dist/commands/commit-command.d.ts.map +1 -1
  74. package/dist/commands/core-config.d.ts +78 -1
  75. package/dist/commands/core-config.d.ts.map +1 -1
  76. package/dist/commands/date-format.d.ts +58 -0
  77. package/dist/commands/date-format.d.ts.map +1 -0
  78. package/dist/commands/default-branch.d.ts +70 -0
  79. package/dist/commands/default-branch.d.ts.map +1 -0
  80. package/dist/commands/describe-command.d.ts.map +1 -1
  81. package/dist/commands/diff-command.d.ts +377 -30
  82. package/dist/commands/diff-command.d.ts.map +1 -1
  83. package/dist/commands/diff-textconv.d.ts +40 -0
  84. package/dist/commands/diff-textconv.d.ts.map +1 -0
  85. package/dist/commands/fetch-command.d.ts +149 -10
  86. package/dist/commands/fetch-command.d.ts.map +1 -1
  87. package/dist/commands/format-patch-command.d.ts +164 -0
  88. package/dist/commands/format-patch-command.d.ts.map +1 -0
  89. package/dist/commands/fsck/fetch-fsck.d.ts +60 -0
  90. package/dist/commands/fsck/fetch-fsck.d.ts.map +1 -0
  91. package/dist/commands/fsck/fsck-command.d.ts +227 -0
  92. package/dist/commands/fsck/fsck-command.d.ts.map +1 -0
  93. package/dist/commands/fsck/fsck-loose.d.ts +71 -0
  94. package/dist/commands/fsck/fsck-loose.d.ts.map +1 -0
  95. package/dist/commands/fsck/fsck-msg-ids.d.ts +122 -0
  96. package/dist/commands/fsck/fsck-msg-ids.d.ts.map +1 -0
  97. package/dist/commands/fsck/fsck-object-checks.d.ts +159 -0
  98. package/dist/commands/fsck/fsck-object-checks.d.ts.map +1 -0
  99. package/dist/commands/fsck/fsck-object-table.d.ts +140 -0
  100. package/dist/commands/fsck/fsck-object-table.d.ts.map +1 -0
  101. package/dist/commands/fsck/fsck-pack.d.ts +122 -0
  102. package/dist/commands/fsck/fsck-pack.d.ts.map +1 -0
  103. package/dist/commands/fsck/index.d.ts +6 -0
  104. package/dist/commands/fsck/index.d.ts.map +1 -0
  105. package/dist/commands/fsck/verify-pack-command.d.ts +81 -0
  106. package/dist/commands/fsck/verify-pack-command.d.ts.map +1 -0
  107. package/dist/commands/gc-command.d.ts +106 -39
  108. package/dist/commands/gc-command.d.ts.map +1 -1
  109. package/dist/commands/git-date.d.ts +2 -0
  110. package/dist/commands/git-date.d.ts.map +1 -0
  111. package/dist/commands/git-describe.d.ts +67 -0
  112. package/dist/commands/git-describe.d.ts.map +1 -0
  113. package/dist/commands/git-hooks.d.ts +424 -0
  114. package/dist/commands/git-hooks.d.ts.map +1 -0
  115. package/dist/commands/git-ident.d.ts +128 -0
  116. package/dist/commands/git-ident.d.ts.map +1 -0
  117. package/dist/commands/hook-command.d.ts +96 -0
  118. package/dist/commands/hook-command.d.ts.map +1 -0
  119. package/dist/commands/index-adder.d.ts +233 -0
  120. package/dist/commands/index-adder.d.ts.map +1 -0
  121. package/dist/commands/index-host.d.ts +86 -0
  122. package/dist/commands/index-host.d.ts.map +1 -0
  123. package/dist/commands/index.d.ts +56 -0
  124. package/dist/commands/index.d.ts.map +1 -1
  125. package/dist/commands/index.js +3 -2
  126. package/dist/commands/init-command.d.ts +62 -4
  127. package/dist/commands/init-command.d.ts.map +1 -1
  128. package/dist/commands/legacy-remotes.d.ts +55 -0
  129. package/dist/commands/legacy-remotes.d.ts.map +1 -0
  130. package/dist/commands/local-clone.d.ts +60 -0
  131. package/dist/commands/local-clone.d.ts.map +1 -0
  132. package/dist/commands/local-transport.d.ts +117 -0
  133. package/dist/commands/local-transport.d.ts.map +1 -0
  134. package/dist/commands/log-command.d.ts +216 -24
  135. package/dist/commands/log-command.d.ts.map +1 -1
  136. package/dist/commands/log-graph.d.ts +120 -0
  137. package/dist/commands/log-graph.d.ts.map +1 -0
  138. package/dist/commands/log-output.d.ts +323 -0
  139. package/dist/commands/log-output.d.ts.map +1 -0
  140. package/dist/commands/ls-remote-command.d.ts +23 -7
  141. package/dist/commands/ls-remote-command.d.ts.map +1 -1
  142. package/dist/commands/mailmap.d.ts +31 -0
  143. package/dist/commands/mailmap.d.ts.map +1 -0
  144. package/dist/commands/merge-bases.d.ts +85 -0
  145. package/dist/commands/merge-bases.d.ts.map +1 -0
  146. package/dist/commands/merge-command.d.ts +221 -74
  147. package/dist/commands/merge-command.d.ts.map +1 -1
  148. package/dist/commands/merge-config.d.ts +13 -0
  149. package/dist/commands/merge-config.d.ts.map +1 -0
  150. package/dist/commands/merge-drivers.d.ts +130 -0
  151. package/dist/commands/merge-drivers.d.ts.map +1 -0
  152. package/dist/commands/merge-support.d.ts +260 -0
  153. package/dist/commands/merge-support.d.ts.map +1 -0
  154. package/dist/commands/message-cleanup.d.ts +86 -0
  155. package/dist/commands/message-cleanup.d.ts.map +1 -0
  156. package/dist/commands/mv-command.d.ts +94 -0
  157. package/dist/commands/mv-command.d.ts.map +1 -0
  158. package/dist/commands/notes-command.d.ts +256 -0
  159. package/dist/commands/notes-command.d.ts.map +1 -0
  160. package/dist/commands/notes-commands.d.ts +41 -0
  161. package/dist/commands/notes-commands.d.ts.map +1 -0
  162. package/dist/commands/notes-merge-command.d.ts +105 -0
  163. package/dist/commands/notes-merge-command.d.ts.map +1 -0
  164. package/dist/commands/notes-support.d.ts +125 -0
  165. package/dist/commands/notes-support.d.ts.map +1 -0
  166. package/dist/commands/notes-tree.d.ts +116 -0
  167. package/dist/commands/notes-tree.d.ts.map +1 -0
  168. package/dist/commands/object-id-input.d.ts +20 -0
  169. package/dist/commands/object-id-input.d.ts.map +1 -0
  170. package/dist/commands/octopus-merge.d.ts +59 -0
  171. package/dist/commands/octopus-merge.d.ts.map +1 -0
  172. package/dist/commands/ort-merge.d.ts +126 -0
  173. package/dist/commands/ort-merge.d.ts.map +1 -0
  174. package/dist/commands/ort-recursive.d.ts +53 -0
  175. package/dist/commands/ort-recursive.d.ts.map +1 -0
  176. package/dist/commands/pack-refs-command.d.ts +20 -0
  177. package/dist/commands/pack-refs-command.d.ts.map +1 -1
  178. package/dist/commands/patch-id.d.ts +44 -0
  179. package/dist/commands/patch-id.d.ts.map +1 -0
  180. package/dist/commands/pathspec-attributes.d.ts +64 -0
  181. package/dist/commands/pathspec-attributes.d.ts.map +1 -0
  182. package/dist/commands/pathspec.d.ts +324 -0
  183. package/dist/commands/pathspec.d.ts.map +1 -0
  184. package/dist/commands/post-index-change.d.ts +33 -0
  185. package/dist/commands/post-index-change.d.ts.map +1 -0
  186. package/dist/commands/pretty-format.d.ts +222 -0
  187. package/dist/commands/pretty-format.d.ts.map +1 -0
  188. package/dist/commands/promisor-remote.d.ts +80 -0
  189. package/dist/commands/promisor-remote.d.ts.map +1 -0
  190. package/dist/commands/pull-command.d.ts +59 -8
  191. package/dist/commands/pull-command.d.ts.map +1 -1
  192. package/dist/commands/push-command.d.ts +24 -8
  193. package/dist/commands/push-command.d.ts.map +1 -1
  194. package/dist/commands/read-tree-command.d.ts +112 -0
  195. package/dist/commands/read-tree-command.d.ts.map +1 -0
  196. package/dist/commands/rebase-command.d.ts +507 -75
  197. package/dist/commands/rebase-command.d.ts.map +1 -1
  198. package/dist/commands/rebase-todo.d.ts +130 -0
  199. package/dist/commands/rebase-todo.d.ts.map +1 -0
  200. package/dist/commands/ref-decoration-filter.d.ts +53 -0
  201. package/dist/commands/ref-decoration-filter.d.ts.map +1 -0
  202. package/dist/commands/reflog-messages.d.ts +98 -0
  203. package/dist/commands/reflog-messages.d.ts.map +1 -0
  204. package/dist/commands/remote-command.d.ts +31 -0
  205. package/dist/commands/remote-command.d.ts.map +1 -1
  206. package/dist/commands/remote-transport.d.ts +120 -0
  207. package/dist/commands/remote-transport.d.ts.map +1 -0
  208. package/dist/commands/reset-command.d.ts +161 -7
  209. package/dist/commands/reset-command.d.ts.map +1 -1
  210. package/dist/commands/restore-command.d.ts +103 -0
  211. package/dist/commands/restore-command.d.ts.map +1 -0
  212. package/dist/commands/rev-list-command.d.ts +78 -0
  213. package/dist/commands/rev-list-command.d.ts.map +1 -0
  214. package/dist/commands/rev-parse-command.d.ts +89 -0
  215. package/dist/commands/rev-parse-command.d.ts.map +1 -0
  216. package/dist/commands/revert-command.d.ts +46 -38
  217. package/dist/commands/revert-command.d.ts.map +1 -1
  218. package/dist/commands/revision-filenames.d.ts +95 -0
  219. package/dist/commands/revision-filenames.d.ts.map +1 -0
  220. package/dist/commands/revision-range.d.ts +67 -0
  221. package/dist/commands/revision-range.d.ts.map +1 -0
  222. package/dist/commands/revision-resolver.d.ts +325 -0
  223. package/dist/commands/revision-resolver.d.ts.map +1 -0
  224. package/dist/commands/rm-command.d.ts +69 -7
  225. package/dist/commands/rm-command.d.ts.map +1 -1
  226. package/dist/commands/sequencer-pick.d.ts +191 -0
  227. package/dist/commands/sequencer-pick.d.ts.map +1 -0
  228. package/dist/commands/sequencer-support.d.ts +125 -0
  229. package/dist/commands/sequencer-support.d.ts.map +1 -0
  230. package/dist/commands/serve-repository.d.ts +52 -0
  231. package/dist/commands/serve-repository.d.ts.map +1 -0
  232. package/dist/commands/sparse-checkout-command.d.ts +190 -0
  233. package/dist/commands/sparse-checkout-command.d.ts.map +1 -0
  234. package/dist/commands/sparse-checkout-support.d.ts +268 -0
  235. package/dist/commands/sparse-checkout-support.d.ts.map +1 -0
  236. package/dist/commands/stash-apply-command.d.ts +42 -8
  237. package/dist/commands/stash-apply-command.d.ts.map +1 -1
  238. package/dist/commands/stash-create-command.d.ts +156 -2
  239. package/dist/commands/stash-create-command.d.ts.map +1 -1
  240. package/dist/commands/stash-drop-command.d.ts +2 -0
  241. package/dist/commands/stash-drop-command.d.ts.map +1 -1
  242. package/dist/commands/stash-working-tree.d.ts +23 -0
  243. package/dist/commands/stash-working-tree.d.ts.map +1 -1
  244. package/dist/commands/status-command.d.ts +300 -15
  245. package/dist/commands/status-command.d.ts.map +1 -1
  246. package/dist/commands/status-format.d.ts +155 -0
  247. package/dist/commands/status-format.d.ts.map +1 -0
  248. package/dist/commands/status-header.d.ts +64 -0
  249. package/dist/commands/status-header.d.ts.map +1 -0
  250. package/dist/commands/strerror.d.ts +7 -0
  251. package/dist/commands/strerror.d.ts.map +1 -0
  252. package/dist/commands/submodule-config.d.ts +38 -0
  253. package/dist/commands/submodule-config.d.ts.map +1 -0
  254. package/dist/commands/submodule-summary-command.d.ts +80 -0
  255. package/dist/commands/submodule-summary-command.d.ts.map +1 -0
  256. package/dist/commands/submodule-summary.d.ts +150 -0
  257. package/dist/commands/submodule-summary.d.ts.map +1 -0
  258. package/dist/commands/switch-command.d.ts +132 -0
  259. package/dist/commands/switch-command.d.ts.map +1 -0
  260. package/dist/commands/tag-command.d.ts +23 -2
  261. package/dist/commands/tag-command.d.ts.map +1 -1
  262. package/dist/commands/tracking-info.d.ts +64 -0
  263. package/dist/commands/tracking-info.d.ts.map +1 -0
  264. package/dist/commands/trailers.d.ts +73 -0
  265. package/dist/commands/trailers.d.ts.map +1 -0
  266. package/dist/commands/tree-restore.d.ts +85 -1
  267. package/dist/commands/tree-restore.d.ts.map +1 -1
  268. package/dist/commands/untracked-cache-support.d.ts +54 -0
  269. package/dist/commands/untracked-cache-support.d.ts.map +1 -0
  270. package/dist/commands/worktree-add-command.d.ts +108 -0
  271. package/dist/commands/worktree-add-command.d.ts.map +1 -0
  272. package/dist/commands/worktree-list-command.d.ts +69 -0
  273. package/dist/commands/worktree-list-command.d.ts.map +1 -0
  274. package/dist/commands/worktree-lock-command.d.ts +44 -0
  275. package/dist/commands/worktree-lock-command.d.ts.map +1 -0
  276. package/dist/commands/worktree-overwrite-checks.d.ts +146 -6
  277. package/dist/commands/worktree-overwrite-checks.d.ts.map +1 -1
  278. package/dist/commands/worktree-prune-command.d.ts +48 -0
  279. package/dist/commands/worktree-prune-command.d.ts.map +1 -0
  280. package/dist/commands/worktree-remove-command.d.ts +59 -0
  281. package/dist/commands/worktree-remove-command.d.ts.map +1 -0
  282. package/dist/commands/worktree-repair-command.d.ts +35 -0
  283. package/dist/commands/worktree-repair-command.d.ts.map +1 -0
  284. package/dist/commands/worktree-support.d.ts +64 -0
  285. package/dist/commands/worktree-support.d.ts.map +1 -0
  286. package/dist/commands-DIJ91NnD.js +62225 -0
  287. package/dist/core-commands/add.command.impl.d.ts.map +1 -1
  288. package/dist/errors/add-errors.d.ts +55 -0
  289. package/dist/errors/add-errors.d.ts.map +1 -1
  290. package/dist/errors/checkout-errors.d.ts +16 -0
  291. package/dist/errors/checkout-errors.d.ts.map +1 -1
  292. package/dist/errors/command-errors.d.ts +77 -0
  293. package/dist/errors/command-errors.d.ts.map +1 -1
  294. package/dist/errors/commit-errors.d.ts +9 -0
  295. package/dist/errors/commit-errors.d.ts.map +1 -1
  296. package/dist/errors/git-api-error.d.ts +59 -2
  297. package/dist/errors/git-api-error.d.ts.map +1 -1
  298. package/dist/errors/index.d.ts +1 -0
  299. package/dist/errors/index.d.ts.map +1 -1
  300. package/dist/errors/index.js +354 -19
  301. package/dist/errors/rebase-errors.d.ts +9 -0
  302. package/dist/errors/rebase-errors.d.ts.map +1 -1
  303. package/dist/errors/ref-errors.d.ts +32 -0
  304. package/dist/errors/ref-errors.d.ts.map +1 -1
  305. package/dist/errors/transport-errors.d.ts +12 -2
  306. package/dist/errors/transport-errors.d.ts.map +1 -1
  307. package/dist/errors/worktree-errors.d.ts +35 -0
  308. package/dist/errors/worktree-errors.d.ts.map +1 -0
  309. package/dist/git-command-BGiOJ8Zk.js +7246 -0
  310. package/dist/git-command.d.ts +428 -32
  311. package/dist/git-command.d.ts.map +1 -1
  312. package/dist/git.d.ts +315 -5
  313. package/dist/git.d.ts.map +1 -1
  314. package/dist/index.d.ts +1 -1
  315. package/dist/index.d.ts.map +1 -1
  316. package/dist/index.js +5 -5
  317. package/dist/remote-config/index.d.ts +1 -1
  318. package/dist/remote-config/index.d.ts.map +1 -1
  319. package/dist/remote-config/remote-config-store.d.ts +167 -6
  320. package/dist/remote-config/remote-config-store.d.ts.map +1 -1
  321. package/dist/remote-config/remote-refs.d.ts +7 -3
  322. package/dist/remote-config/remote-refs.d.ts.map +1 -1
  323. package/dist/rename/detect-renames.d.ts +148 -0
  324. package/dist/rename/detect-renames.d.ts.map +1 -0
  325. package/dist/rename/git-similarity.d.ts +44 -0
  326. package/dist/rename/git-similarity.d.ts.map +1 -0
  327. package/dist/rename/index.d.ts +2 -0
  328. package/dist/rename/index.d.ts.map +1 -1
  329. package/dist/results/binary-patch.d.ts +11 -0
  330. package/dist/results/binary-patch.d.ts.map +1 -0
  331. package/dist/results/blame-format.d.ts +55 -0
  332. package/dist/results/blame-format.d.ts.map +1 -0
  333. package/dist/results/cherry-pick-result.d.ts +10 -0
  334. package/dist/results/cherry-pick-result.d.ts.map +1 -1
  335. package/dist/results/clone-result.d.ts +18 -0
  336. package/dist/results/clone-result.d.ts.map +1 -1
  337. package/dist/results/combined-diff.d.ts +77 -0
  338. package/dist/results/combined-diff.d.ts.map +1 -0
  339. package/dist/results/diff-entry.d.ts +32 -0
  340. package/dist/results/diff-entry.d.ts.map +1 -1
  341. package/dist/results/diff-formatter.d.ts +34 -60
  342. package/dist/results/diff-formatter.d.ts.map +1 -1
  343. package/dist/results/diff-order.d.ts +25 -0
  344. package/dist/results/diff-order.d.ts.map +1 -0
  345. package/dist/results/diff-output.d.ts +249 -0
  346. package/dist/results/diff-output.d.ts.map +1 -0
  347. package/dist/results/fetch-result.d.ts +15 -0
  348. package/dist/results/fetch-result.d.ts.map +1 -1
  349. package/dist/results/index.d.ts +5 -0
  350. package/dist/results/index.d.ts.map +1 -1
  351. package/dist/results/index.js +2 -252
  352. package/dist/results/init-result.d.ts +7 -0
  353. package/dist/results/init-result.d.ts.map +1 -1
  354. package/dist/results/merge-result.d.ts +15 -1
  355. package/dist/results/merge-result.d.ts.map +1 -1
  356. package/dist/results/pull-result.d.ts +17 -3
  357. package/dist/results/pull-result.d.ts.map +1 -1
  358. package/dist/results/push-result.d.ts +47 -0
  359. package/dist/results/push-result.d.ts.map +1 -1
  360. package/dist/results/quote-path.d.ts +27 -0
  361. package/dist/results/quote-path.d.ts.map +1 -0
  362. package/dist/results/rebase-result.d.ts +28 -1
  363. package/dist/results/rebase-result.d.ts.map +1 -1
  364. package/dist/results/revert-result.d.ts +10 -0
  365. package/dist/results/revert-result.d.ts.map +1 -1
  366. package/dist/results/stash-result.d.ts +5 -0
  367. package/dist/results/stash-result.d.ts.map +1 -1
  368. package/dist/results/status-result.d.ts +60 -6
  369. package/dist/results/status-result.d.ts.map +1 -1
  370. package/dist/results-WVlBhVb1.js +2935 -0
  371. package/dist/transport-command.d.ts +44 -1
  372. package/dist/transport-command.d.ts.map +1 -1
  373. package/package.json +15 -11
  374. package/src/commands/add-command.ts +1291 -226
  375. package/src/commands/add-patch/add-interactive.ts +941 -0
  376. package/src/commands/add-patch/add-patch.ts +1169 -0
  377. package/src/commands/add-patch/index.ts +5 -0
  378. package/src/commands/add-patch/patch-backend.ts +239 -0
  379. package/src/commands/add-patch/patch-modes.ts +249 -0
  380. package/src/commands/add-patch/patch-session.ts +159 -0
  381. package/src/commands/am/am-command.ts +1111 -0
  382. package/src/commands/am/index.ts +2 -0
  383. package/src/commands/am/mailinfo.ts +1015 -0
  384. package/src/commands/am/patch-format.ts +121 -0
  385. package/src/commands/apply/apply-command.ts +842 -0
  386. package/src/commands/apply/apply-engine.ts +1602 -0
  387. package/src/commands/apply/apply-parse.ts +1210 -0
  388. package/src/commands/apply/apply-types.ts +112 -0
  389. package/src/commands/apply/index.ts +5 -0
  390. package/src/commands/apply/latin1.ts +171 -0
  391. package/src/commands/apply/whitespace.ts +260 -0
  392. package/src/commands/attributes-source.ts +96 -0
  393. package/src/commands/backfill-command.ts +694 -0
  394. package/src/commands/bisect/bisect-checkout.ts +217 -0
  395. package/src/commands/bisect/bisect-command.ts +788 -0
  396. package/src/commands/bisect/bisect-engine.ts +1080 -0
  397. package/src/commands/bisect/bisect-graph.ts +595 -0
  398. package/src/commands/bisect/bisect-quote.ts +92 -0
  399. package/src/commands/bisect/index.ts +4 -0
  400. package/src/commands/blame-command.ts +711 -986
  401. package/src/commands/branch-command.ts +354 -32
  402. package/src/commands/branch-tracking.ts +331 -0
  403. package/src/commands/checkout-command.ts +1290 -243
  404. package/src/commands/checkout-paths.ts +784 -0
  405. package/src/commands/cherry-pick-command.ts +156 -396
  406. package/src/commands/clean-command.ts +504 -156
  407. package/src/commands/clone-command.ts +748 -69
  408. package/src/commands/comment-char-config.ts +160 -0
  409. package/src/commands/commit-command.ts +1782 -166
  410. package/src/commands/core-config.ts +166 -6
  411. package/src/commands/date-format.ts +668 -0
  412. package/src/commands/default-branch.ts +196 -0
  413. package/src/commands/describe-command.ts +2 -0
  414. package/src/commands/diff-command.ts +1916 -110
  415. package/src/commands/diff-textconv.ts +50 -0
  416. package/src/commands/fetch-command.ts +622 -68
  417. package/src/commands/format-patch-command.ts +974 -0
  418. package/src/commands/fsck/fetch-fsck.ts +229 -0
  419. package/src/commands/fsck/fsck-command.ts +3464 -0
  420. package/src/commands/fsck/fsck-loose.ts +297 -0
  421. package/src/commands/fsck/fsck-msg-ids.ts +176 -0
  422. package/src/commands/fsck/fsck-object-checks.ts +1085 -0
  423. package/src/commands/fsck/fsck-object-table.ts +373 -0
  424. package/src/commands/fsck/fsck-pack.ts +634 -0
  425. package/src/commands/fsck/index.ts +5 -0
  426. package/src/commands/fsck/verify-pack-command.ts +252 -0
  427. package/src/commands/gc-command.ts +324 -77
  428. package/src/commands/git-date.ts +9 -0
  429. package/src/commands/git-describe.ts +316 -0
  430. package/src/commands/git-hooks.ts +1483 -0
  431. package/src/commands/git-ident.ts +344 -0
  432. package/src/commands/hook-command.ts +247 -0
  433. package/src/commands/index-adder.ts +711 -0
  434. package/src/commands/index-host.ts +291 -0
  435. package/src/commands/index.ts +84 -0
  436. package/src/commands/init-command.ts +194 -14
  437. package/src/commands/legacy-remotes.ts +224 -0
  438. package/src/commands/local-clone.ts +183 -0
  439. package/src/commands/local-transport.ts +762 -0
  440. package/src/commands/log-command.ts +1930 -170
  441. package/src/commands/log-graph.ts +671 -0
  442. package/src/commands/log-output.ts +1359 -0
  443. package/src/commands/ls-remote-command.ts +105 -58
  444. package/src/commands/mailmap.ts +129 -0
  445. package/src/commands/merge-bases.ts +296 -0
  446. package/src/commands/merge-command.ts +1416 -491
  447. package/src/commands/merge-config.ts +25 -0
  448. package/src/commands/merge-drivers.ts +306 -0
  449. package/src/commands/merge-support.ts +1219 -0
  450. package/src/commands/message-cleanup.ts +275 -0
  451. package/src/commands/mv-command.ts +976 -0
  452. package/src/commands/notes-command.ts +890 -0
  453. package/src/commands/notes-commands.ts +87 -0
  454. package/src/commands/notes-merge-command.ts +777 -0
  455. package/src/commands/notes-support.ts +402 -0
  456. package/src/commands/notes-tree.ts +617 -0
  457. package/src/commands/object-id-input.ts +27 -0
  458. package/src/commands/octopus-merge.ts +378 -0
  459. package/src/commands/ort-merge.ts +1660 -0
  460. package/src/commands/ort-recursive.ts +160 -0
  461. package/src/commands/pack-refs-command.ts +39 -22
  462. package/src/commands/patch-id.ts +204 -0
  463. package/src/commands/pathspec-attributes.ts +162 -0
  464. package/src/commands/pathspec.ts +1199 -0
  465. package/src/commands/post-index-change.ts +62 -0
  466. package/src/commands/pretty-format.ts +1432 -0
  467. package/src/commands/promisor-remote.ts +298 -0
  468. package/src/commands/pull-command.ts +326 -33
  469. package/src/commands/push-command.ts +257 -29
  470. package/src/commands/read-tree-command.ts +861 -0
  471. package/src/commands/rebase-command.ts +3820 -372
  472. package/src/commands/rebase-todo.ts +584 -0
  473. package/src/commands/ref-decoration-filter.ts +118 -0
  474. package/src/commands/reflog-messages.ts +177 -0
  475. package/src/commands/remote-command.ts +124 -23
  476. package/src/commands/remote-transport.ts +383 -0
  477. package/src/commands/reset-command.ts +821 -104
  478. package/src/commands/restore-command.ts +350 -0
  479. package/src/commands/rev-list-command.ts +167 -0
  480. package/src/commands/rev-parse-command.ts +299 -0
  481. package/src/commands/revert-command.ts +152 -399
  482. package/src/commands/revision-filenames.ts +254 -0
  483. package/src/commands/revision-range.ts +222 -0
  484. package/src/commands/revision-resolver.ts +1397 -0
  485. package/src/commands/rm-command.ts +613 -67
  486. package/src/commands/sequencer-pick.ts +874 -0
  487. package/src/commands/sequencer-support.ts +876 -0
  488. package/src/commands/serve-repository.ts +125 -0
  489. package/src/commands/sparse-checkout-command.ts +1389 -0
  490. package/src/commands/sparse-checkout-support.ts +793 -0
  491. package/src/commands/stash-apply-command.ts +376 -343
  492. package/src/commands/stash-create-command.ts +625 -42
  493. package/src/commands/stash-drop-command.ts +15 -2
  494. package/src/commands/stash-working-tree.ts +168 -24
  495. package/src/commands/status-command.ts +1326 -105
  496. package/src/commands/status-format.ts +775 -0
  497. package/src/commands/status-header.ts +332 -0
  498. package/src/commands/strerror.ts +29 -0
  499. package/src/commands/submodule-config.ts +94 -0
  500. package/src/commands/submodule-summary-command.ts +333 -0
  501. package/src/commands/submodule-summary.ts +446 -0
  502. package/src/commands/switch-command.ts +402 -0
  503. package/src/commands/tag-command.ts +129 -41
  504. package/src/commands/tracking-info.ts +201 -0
  505. package/src/commands/trailers.ts +417 -0
  506. package/src/commands/tree-restore.ts +204 -4
  507. package/src/commands/untracked-cache-support.ts +198 -0
  508. package/src/commands/worktree-add-command.ts +458 -0
  509. package/src/commands/worktree-list-command.ts +206 -0
  510. package/src/commands/worktree-lock-command.ts +96 -0
  511. package/src/commands/worktree-overwrite-checks.ts +452 -26
  512. package/src/commands/worktree-prune-command.ts +99 -0
  513. package/src/commands/worktree-remove-command.ts +186 -0
  514. package/src/commands/worktree-repair-command.ts +59 -0
  515. package/src/commands/worktree-support.ts +214 -0
  516. package/src/core-commands/add.command.impl.ts +8 -2
  517. package/src/errors/add-errors.ts +45 -0
  518. package/src/errors/checkout-errors.ts +26 -2
  519. package/src/errors/command-errors.ts +101 -1
  520. package/src/errors/commit-errors.ts +18 -2
  521. package/src/errors/git-api-error.ts +82 -2
  522. package/src/errors/index.ts +1 -0
  523. package/src/errors/merge-errors.ts +2 -2
  524. package/src/errors/rebase-errors.ts +12 -0
  525. package/src/errors/ref-errors.ts +56 -2
  526. package/src/errors/remote-errors.ts +2 -2
  527. package/src/errors/stash-errors.ts +1 -1
  528. package/src/errors/transport-errors.ts +20 -4
  529. package/src/errors/worktree-errors.ts +49 -0
  530. package/src/git-command.ts +1207 -118
  531. package/src/git.ts +538 -12
  532. package/src/index.ts +1 -1
  533. package/src/remote-config/index.ts +2 -0
  534. package/src/remote-config/remote-config-store.ts +378 -18
  535. package/src/remote-config/remote-refs.ts +22 -6
  536. package/src/rename/detect-renames.ts +715 -0
  537. package/src/rename/git-similarity.ts +116 -0
  538. package/src/rename/index.ts +2 -0
  539. package/src/results/binary-patch.ts +401 -0
  540. package/src/results/blame-format.ts +239 -0
  541. package/src/results/cherry-pick-result.ts +10 -0
  542. package/src/results/clone-result.ts +21 -0
  543. package/src/results/combined-diff.ts +585 -0
  544. package/src/results/diff-entry.ts +35 -0
  545. package/src/results/diff-formatter.ts +152 -288
  546. package/src/results/diff-order.ts +64 -0
  547. package/src/results/diff-output.ts +1053 -0
  548. package/src/results/fetch-result.ts +15 -0
  549. package/src/results/index.ts +5 -0
  550. package/src/results/init-result.ts +9 -0
  551. package/src/results/merge-result.ts +15 -1
  552. package/src/results/pull-result.ts +17 -3
  553. package/src/results/push-result.ts +48 -0
  554. package/src/results/quote-path.ts +103 -0
  555. package/src/results/rebase-result.ts +37 -0
  556. package/src/results/revert-result.ts +10 -0
  557. package/src/results/stash-result.ts +6 -0
  558. package/src/results/status-result.ts +127 -46
  559. package/src/transport-command.ts +121 -2
  560. package/dist/commands-CsLNyvZ1.js +0 -12587
  561. package/dist/status-result-BpyUK1Sg.js +0 -519
@@ -1 +1 @@
1
- {"version":3,"file":"rebase-command.d.ts","sourceRoot":"","sources":["../../src/commands/rebase-command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAe,MAAM,uBAAuB,CA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C1E,QAAQ;IAWtB;;;;;OAKG;YACW,gBAAgB;IAgB9B,yFAAyF;YAC3E,eAAe;IAS7B,oFAAoF;IACpF,OAAO,CAAC,wBAAwB;IAWhC;;;OAGG;YACW,cAAc;IA6B5B,uFAAuF;YACzE,QAAQ;IAMtB;;;OAGG;YACW,iBAAiB;IA+D/B;;;;OAIG;YACW,QAAQ;IAuEtB,qFAAqF;YACvE,cAAc;IAa5B,uFAAuF;YACzE,eAAe;IAY7B;;;;;OAKG;YACW,oBAAoB;IA6DlC;;;OAGG;YACW,gBAAgB;IAyB9B,kDAAkD;YACpC,eAAe;IAY7B;;;OAGG;YACW,YAAY;IA8B1B;;;;;OAKG;YACW,eAAe;IA4B7B,2FAA2F;IAC3F,OAAO,CAAC,SAAS;IAejB;;;OAGG;YACW,cAAc;IAmB5B;;;;;OAKG;YACW,eAAe;IAmD7B;;;;;;OAMG;YACW,eAAe;IA6D7B;;;;;OAKG;YACW,iBAAiB;IA6D/B,iEAAiE;YACnD,UAAU;IASxB;;;;;OAKG;YACW,cAAc;YAWd,UAAU;CAIzB"}
@@ -0,0 +1,130 @@
1
+ import { type ObjectId } from "@statewalker/vcs-core";
2
+ import { RebaseAction } from "../results/rebase-result.js";
3
+ /**
4
+ * The todo list of git's sequencer (`rebase-merge/git-rebase-todo`): parsing as git's
5
+ * parse_insn_line reads a line, writing as todo_list_to_strbuf writes it, the help text
6
+ * the editor shows (append_todo_help), and the rearrangements git makes before the list is
7
+ * edited (`--autosquash`, `--exec`).
8
+ */
9
+ /** One line of the todo list. */
10
+ export interface TodoItem {
11
+ action: RebaseAction;
12
+ /**
13
+ * The commit of a pick-like command, or the original merge of a `merge -C` (empty for the
14
+ * other commands); as written until the list's names are resolved
15
+ */
16
+ id: ObjectId;
17
+ /**
18
+ * The line's text after the id (`# <subject>`, as `rebase.instructionFormat` made it, or as
19
+ * the todo file has it): written back unchanged, and what `Could not apply` names. The
20
+ * argument of `exec`, `label`, `reset`, `update-ref` and an id-less `merge`, the whole line
21
+ * of a comment (a blank line is one)
22
+ */
23
+ rest?: string;
24
+ /** `merge -c` / `fixup -c`: the message edited */
25
+ editMessage?: boolean;
26
+ /** `fixup -C`: this commit's message replaces the previous one's */
27
+ replaceMessage?: boolean;
28
+ /** A line git could not parse: kept as written (git's TODO_COMMENT + 1) */
29
+ invalid?: boolean;
30
+ /** The line as read from a todo file (written back as it is while the list runs) */
31
+ line?: string;
32
+ /** git's errors for this line (`error: ...`), in the order git prints them */
33
+ errors?: string[];
34
+ /**
35
+ * An `update-ref` (or checked-out comment) --update-refs added: its argument keeps the
36
+ * newline git added it with, so the first list shows a blank line after it
37
+ */
38
+ blankAfter?: boolean;
39
+ }
40
+ /** git's is_noop: `noop`, `drop`, comments and lines that could not be parsed. */
41
+ export declare function isNoop(item: TodoItem): boolean;
42
+ /** git's is_fixup: `fixup` or `squash`. */
43
+ export declare function isFixup(action: RebaseAction | undefined): boolean;
44
+ /** git's is_pick_or_similar: the commands that make a (non-merge) commit. */
45
+ export declare function isPickLike(action: RebaseAction): boolean;
46
+ /** git's count_commands: every item but comments (`noop`, `drop` and bad lines count). */
47
+ export declare function countTodoCommands(items: TodoItem[]): number;
48
+ /** The result of parsing a todo list: its items and git's errors (`error: ...` lines). */
49
+ export interface ParsedTodo {
50
+ items: TodoItem[];
51
+ errors: string[];
52
+ }
53
+ /**
54
+ * A todo list's lines as git's todo_list_parse_insn_buffer reads them. Commit names are
55
+ * kept as written (resolved later); a line git refuses is kept as written (`invalid`) and
56
+ * reported as git reports it (`error: invalid command 'x'`, `error: invalid line 3: x`).
57
+ * `fixupOkay` (`rebase-merge/done` exists): a fixup or squash may start the list.
58
+ */
59
+ export declare function parseTodo(text: string, comment?: string, fixupOkay?: boolean): ParsedTodo;
60
+ /** Whether the command carries a commit (resolved after parsing). */
61
+ export declare function takesCommit(item: TodoItem): boolean;
62
+ /** Options of {@link formatTodo}. */
63
+ export interface FormatTodoOptions {
64
+ /** `rebase.abbreviateCommands`: the commands as their letters */
65
+ abbreviate?: boolean;
66
+ /** The id written for a commit (TODO_LIST_SHORTEN_IDS: abbreviated); default the id */
67
+ idOf?: (id: ObjectId) => string;
68
+ /** Lines read from a file written back as they were read (save_todo) */
69
+ verbatim?: boolean;
70
+ }
71
+ /** git's peek_command: the first command from `offset` on that is not a noop. */
72
+ export declare function peekCommand(items: TodoItem[], offset: number): RebaseAction | undefined;
73
+ /** sequencer.c's is_final_fixup: `items[0]` is a fixup/squash no later one follows. */
74
+ export declare function isFinalFixup(items: TodoItem[]): boolean;
75
+ /** git's todo_list_to_strbuf: each item as a line. */
76
+ export declare function formatTodo(items: TodoItem[], options?: FormatTodoOptions): string;
77
+ /**
78
+ * git's strbuf_add_commented_lines: each line after the comment string and a space (no
79
+ * space before an empty line or a tab), the text ended by a newline.
80
+ */
81
+ export declare function commentLines(out: string, text: string, comment: string): string;
82
+ /**
83
+ * sequencer.c's add_commented_lines: like {@link commentLines}, but the lines at the start
84
+ * that are already comments are copied as they are.
85
+ */
86
+ declare function commentLinesOnce(out: string, text: string, comment: string): string;
87
+ /**
88
+ * rebase-interactive.c's append_todo_help: the help after the list (`# Rebase a..b onto c
89
+ * (n commands)` for a new list, the commands, the warnings).
90
+ */
91
+ export declare function todoHelp(commandCount: number, comment: string, range?: {
92
+ shortRevisions: string;
93
+ shortOnto: string;
94
+ }, missingCommitsError?: boolean): string;
95
+ /**
96
+ * sequencer.c's todo_list_add_exec_commands: the commands after every pick and merge (after
97
+ * the fixup/squash chain that follows it).
98
+ */
99
+ export declare function addExecCommands(items: TodoItem[], commands: string[]): TodoItem[];
100
+ /**
101
+ * sequencer.c's todo_list_rearrange_squash (`--autosquash`): each `fixup! <subject>`,
102
+ * `amend! <subject>` and `squash! <subject>` commit moved after the commit it names (by
103
+ * subject, by a commit name, or by a subject's prefix) and made a `fixup`, `fixup -C` or
104
+ * `squash`; undefined when the list already has fixups (git's "the script was already
105
+ * rearranged.").
106
+ */
107
+ export declare function rearrangeSquash(items: TodoItem[], subjectOf: (id: ObjectId) => Promise<string>, commitNamed: (name: string) => Promise<ObjectId | undefined>): Promise<TodoItem[] | undefined>;
108
+ /** git's find_commit_subject: the message from its first non-blank line. */
109
+ export declare function messageBody(message: string): string;
110
+ /** commit.c's commit_subject_length: the subject paragraph's length (its newlines included). */
111
+ export declare function subjectLength(body: string): number;
112
+ declare const nthMessage: (n: number) => string;
113
+ declare const skipNthMessage: (n: number) => string;
114
+ export declare const combinedMessage: (n: number) => string;
115
+ /**
116
+ * sequencer.c's update_squash_message_for_fixup (a `fixup -C` after fixups): the messages
117
+ * kept so far commented out and said to be skipped, the blank lines around them kept.
118
+ */
119
+ export declare function squashMessageForFixup(message: string, comment: string): string;
120
+ /** The pieces of git's fixup/squash message text, for the command's update_squash_messages. */
121
+ export declare const squashTexts: {
122
+ firstMessage: string;
123
+ nthMessage: typeof nthMessage;
124
+ skipFirstMessage: string;
125
+ skipNthMessage: typeof skipNthMessage;
126
+ combinedMessage: typeof combinedMessage;
127
+ commentLinesOnce: typeof commentLinesOnce;
128
+ };
129
+ export {};
130
+ //# sourceMappingURL=rebase-todo.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rebase-todo.d.ts","sourceRoot":"","sources":["../../src/commands/rebase-todo.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEtE,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAE3D;;;;;GAKG;AAEH,iCAAiC;AACjC,MAAM,WAAW,QAAQ;IACvB,MAAM,EAAE,YAAY,CAAC;IACrB;;;OAGG;IACH,EAAE,EAAE,QAAQ,CAAC;IACb;;;;;OAKG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,kDAAkD;IAClD,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,oEAAoE;IACpE,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,2EAA2E;IAC3E,OAAO,CAAC,EAAE,OAAO,CAAC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AO,MAAM,WAAgD,CAAC;AAClF,eAAO,MAAM,eAAe,MAAO,MAAM,WAA6C,CAAC;AAEvF;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CA0C9E;AAED,+FAA+F;AAC/F,eAAO,MAAM,WAAW;;;;;;;CAOvB,CAAC"}
@@ -0,0 +1,53 @@
1
+ /**
2
+ * Which refs `git log` decorates commits with: builtin/log.c's decoration filter
3
+ * (`--decorate-refs`, `--decorate-refs-exclude`, `--clear-decorations`, and the
4
+ * `log.excludeDecoration`, `log.initialDecorationSet` and `log.decorate` settings) and
5
+ * log-tree.c's ref_filter_match.
6
+ *
7
+ * @example
8
+ * ```typescript
9
+ * const decorates = createRefDecorationFilter({ config: RemoteConfigStore.from(workingCopy) });
10
+ * decorates("refs/heads/main"); // true
11
+ * decorates("refs/notes/commits"); // false: not in the default set
12
+ * ```
13
+ */
14
+ /** The configuration the filter reads (a `RemoteConfigStore` is one). */
15
+ export interface RefDecorationConfig {
16
+ /** Every value of a variable, in the configuration's order */
17
+ values(key: string): string[];
18
+ }
19
+ /** Options of {@link createRefDecorationFilter}. */
20
+ export interface RefDecorationFilterOptions {
21
+ /** `--decorate-refs=<pattern>`: only refs matching one of them are decorated */
22
+ decorateRefs?: readonly string[];
23
+ /** `--decorate-refs-exclude=<pattern>`: refs matching one of them are not decorated */
24
+ decorateRefsExclude?: readonly string[];
25
+ /**
26
+ * `--clear-decorations`: no default set (every ref, unless patterns say otherwise). The
27
+ * patterns given before it on a command line are cleared by it: pass only those after.
28
+ */
29
+ clearDecorations?: boolean;
30
+ /**
31
+ * The configuration: `log.excludeDecoration` (patterns not decorated, unless
32
+ * `--decorate-refs` includes them) and `log.initialDecorationSet` (`all`: no default set)
33
+ */
34
+ config?: RefDecorationConfig;
35
+ /** Where replace refs live (`GIT_REPLACE_REF_BASE`; default `refs/replace/`) */
36
+ replaceRefBase?: string;
37
+ }
38
+ /**
39
+ * Whether git's `git log` decorates commits with a ref (log-tree.c's ref_filter_match over
40
+ * the filter builtin/log.c sets up): a ref matching an excluding pattern is not; with
41
+ * including patterns, only a ref matching one of them is; else one matching a pattern of
42
+ * `log.excludeDecoration` is not. Without patterns on the command line or in the
43
+ * configuration, only the default set is decorated (HEAD, `refs/heads/`, `refs/tags/`,
44
+ * `refs/remotes/`, `refs/stash`, the replace refs), unless `--clear-decorations` or
45
+ * `log.initialDecorationSet=all` asks for every ref.
46
+ */
47
+ export declare function createRefDecorationFilter(options?: RefDecorationFilterOptions): (refName: string) => boolean;
48
+ /**
49
+ * Whether `log.decorate` asks for full ref names (`full`): `%d` and friends then show
50
+ * `refs/heads/main` where they show `main` by default (`short`, a boolean, `auto`).
51
+ */
52
+ export declare function decorateFullRefs(config: RefDecorationConfig | undefined): boolean;
53
+ //# sourceMappingURL=ref-decoration-filter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ref-decoration-filter.d.ts","sourceRoot":"","sources":["../../src/commands/ref-decoration-filter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAKH,yEAAyE;AACzE,MAAM,WAAW,mBAAmB;IAClC,8DAA8D;IAC9D,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;CAC/B;AAED,oDAAoD;AACpD,MAAM,WAAW,0BAA0B;IACzC,gFAAgF;IAChF,YAAY,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACjC,uFAAuF;IACvF,mBAAmB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACxC;;;OAGG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B;;;OAGG;IACH,MAAM,CAAC,EAAE,mBAAmB,CAAC;IAC7B,gFAAgF;IAChF,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAkCD;;;;;;;;GAQG;AACH,wBAAgB,yBAAyB,CACvC,OAAO,GAAE,0BAA+B,GACvC,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAqB9B;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,mBAAmB,GAAG,SAAS,GAAG,OAAO,CAIjF"}
@@ -0,0 +1,98 @@
1
+ /**
2
+ * The reflog lines our porcelain writes, as native git writes them: one place for the
3
+ * messages of each command (checked against git 2.43 and git's sources: `builtin/*.c`,
4
+ * `sequencer.c`, `reset.c`), and the identity and time of a line (`git_committer_info`).
5
+ *
6
+ * @example
7
+ * ```typescript
8
+ * const log = reflogLine(workingCopy, reflogMessages.reset("HEAD~1"));
9
+ * await updateHead(refs, targetId, log); // the branch and HEAD: "reset: moving to HEAD~1"
10
+ * ```
11
+ */
12
+ import { type ObjectId, type PersonIdent, type RefLogOptions, type Refs } from "@statewalker/vcs-core";
13
+ import type { WorkingCopy } from "@statewalker/vcs-working-tree";
14
+ /**
15
+ * The identity and time of a reflog line written now, as git's `git_committer_info` builds
16
+ * it (not strict): `GIT_COMMITTER_NAME` / `GIT_COMMITTER_EMAIL` / `GIT_COMMITTER_DATE` (the
17
+ * host environment's `committer`, on the working copy's configuration), else
18
+ * `committer.name` / `committer.email`, `user.name` / `user.email` and the clock (`now`, in
19
+ * seconds, when the caller read it once for all its lines, as git reads its default date
20
+ * once per process). Undefined when neither names anyone: the ref store's own identity is
21
+ * used then.
22
+ */
23
+ export declare function committerIdent(workingCopy: WorkingCopy, now?: number): PersonIdent | undefined;
24
+ /**
25
+ * A reflog line's options: `message`, with `who` as its identity (a commit's committer),
26
+ * else {@link committerIdent} at `now` (seconds; the clock when omitted).
27
+ */
28
+ export declare function reflogLine(workingCopy: WorkingCopy, message: string, who?: PersonIdent, now?: number): RefLogOptions;
29
+ /**
30
+ * The first line of a commit message as git's commit and sequencer put it in a reflog line:
31
+ * leading blank lines skipped (git's cleanup), whitespace collapsed.
32
+ */
33
+ export declare function reflogSubject(message: string): string;
34
+ /** What a commit records in `commit (<kind>): <subject>` (git's builtin/commit.c). */
35
+ export type CommitReflogKind = "initial" | "amend" | "merge" | "cherry-pick" | undefined;
36
+ /** git's reflog messages, per command. */
37
+ export declare const reflogMessages: {
38
+ /**
39
+ * `git checkout` / `git switch`: `from` is the branch left (short name) or, detached, the
40
+ * full id of HEAD; `to` the argument as given (`feat`, `HEAD~1`, `v1.0`).
41
+ */
42
+ checkout: (from: string, to: string) => string;
43
+ /** `git commit`: `commit: <subject>`, `commit (initial): ...`, `commit (amend): ...` */
44
+ commit: (kind: CommitReflogKind, message: string, action?: string) => string;
45
+ /** `git reset <rev>`: the revision as given, `HEAD` by default. */
46
+ reset: (rev: string) => string;
47
+ /** `git merge <names>`: `merge feat: Fast-forward`, `merge feat: Merge made by ...`. */
48
+ merge: (action: string, outcome: string) => string;
49
+ /** The action of `git merge <names>`, with the names as given. */
50
+ mergeAction: (names: string[]) => string;
51
+ /** The outcome of a merge that made a commit. */
52
+ mergeMade: (strategy: string) => string;
53
+ /** `git cherry-pick` / `git revert` (and a rebase's pick): `<action>: <subject>`. */
54
+ pick: (action: string, message: string) => string;
55
+ /** A rebase detaching HEAD at what it rebases onto, named as given. */
56
+ rebaseStart: (action: string, ontoName: string) => string;
57
+ /** A rebase's `<action> (pick)`, `(continue)`, `(abort)`, `(finish)`. */
58
+ rebaseStep: (action: string, step: string) => string;
59
+ /** The branch a finished rebase moves. */
60
+ rebaseFinishBranch: (action: string, headName: string, onto: ObjectId) => string;
61
+ /** HEAD attached to that branch again. */
62
+ rebaseFinishHead: (action: string, headName: string) => string;
63
+ /** HEAD back on the branch an aborted rebase started from. */
64
+ rebaseAbort: (action: string, headName: string) => string;
65
+ /** A rebase that only switches to the branch named (it is up to date). */
66
+ rebaseCheckout: (action: string, branch: string) => string;
67
+ /** `git clone <url>`: HEAD, the branch and `refs/remotes/<remote>/HEAD`. */
68
+ clone: (url: string) => string;
69
+ /**
70
+ * `git fetch`: `<action>: fast-forward`, `forced-update`, `storing head` (a new ref the
71
+ * remote has under refs/heads/), `storing tag`, `storing ref`, `updating tag`.
72
+ */
73
+ fetch: (action: string, what: string) => string;
74
+ /** `git branch <name> [<start>]` and `checkout -b`: the start point as given, `HEAD` by default. */
75
+ branchCreated: (start: string) => string;
76
+ /** `git branch -f` / `checkout -B` of a branch that exists. */
77
+ branchReset: (start: string) => string;
78
+ /** `git branch -m`. */
79
+ branchRenamed: (from: string, to: string) => string;
80
+ /** `git branch -c`. */
81
+ branchCopied: (from: string, to: string) => string;
82
+ };
83
+ /**
84
+ * Move HEAD to `id` as git's `update_ref("HEAD", ...)` does: through a symbolic HEAD its
85
+ * branch moves (logged in the branch's reflog and HEAD's), a detached HEAD moves itself.
86
+ */
87
+ export declare function updateHead(refs: Refs, id: ObjectId, log?: RefLogOptions): Promise<void>;
88
+ /**
89
+ * Move HEAD to `id` as git's `refs_update_ref("HEAD", id, old)` does: one transaction on
90
+ * HEAD expecting `old` (unchecked when undefined), through a symbolic HEAD to its branch
91
+ * unless `noDeref` (a detached HEAD written as itself), as the reference-transaction hook
92
+ * sees it (`<old> <new> HEAD`). A store whose batches cannot take HEAD sets it plainly; a
93
+ * refusal (HEAD moved meanwhile, its lock held) throws.
94
+ */
95
+ export declare function updateHeadExpecting(refs: Refs, id: ObjectId, old: ObjectId | undefined, log: RefLogOptions | undefined, options?: {
96
+ noDeref?: boolean;
97
+ }): Promise<void>;
98
+ //# sourceMappingURL=reflog-messages.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reflog-messages.d.ts","sourceRoot":"","sources":["../../src/commands/reflog-messages.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAGL,KAAK,QAAQ,EACb,KAAK,WAAW,EAChB,KAAK,aAAa,EAClB,KAAK,IAAI,EACV,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAKjE;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAAC,WAAW,EAAE,WAAW,EAAE,GAAG,CAAC,EAAE,MAAM,GA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C/D,WAAW,UAAU,MAAM;IAC3B,uBAAuB;IACvB,aAAa,SAAS,MAAM,MAAM,MAAM;IACxC,uBAAuB;IACvB,YAAY,SAAS,MAAM,MAAM,MAAM;CACxC,CAAC;AAEF;;;GAGG;AACH,wBAAsB,UAAU,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,EAAE,QAAQ,EAAE,GAAG,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAI7F;AAED;;;;;;GAMG;AACH,wBAAsB,mBAAmB,CACvC,IAAI,EAAE,IAAI,EACV,EAAE,EAAE,QAAQ,EACZ,GAAG,EAAE,QAAQ,GAAG,SAAS,EACzB,GAAG,EAAE,aAAa,GAAG,SAAS,EAC9B,OAAO,GAAE;IAAE,OAAO,CAAC,EAAE,OAAO,CAAA;CAAO,GAClC,OAAO,CAAC,IAAI,CAAC,CAmCf"}
@@ -155,6 +155,8 @@ export declare class RemoteRenameCommand extends GitCommand<RemoteRenameResult>
155
155
  */
156
156
  call(): Promise<RemoteRenameResult>;
157
157
  }
158
+ /** git's valid_remote_name: `refs/remotes/<name>/test` is a valid ref name. */
159
+ export declare function isValidRemoteName(name: string): boolean;
158
160
  /**
159
161
  * List remotes in the repository.
160
162
  *
@@ -182,6 +184,35 @@ export declare class RemoteListCommand extends GitCommand<RemoteConfig[]> {
182
184
  */
183
185
  call(): Promise<RemoteConfig[]>;
184
186
  }
187
+ /**
188
+ * The URLs of a remote as git uses them: `git remote get-url [--push] [--all] <name>`.
189
+ *
190
+ * The URLs are rewritten by `url.<base>.insteadOf` (and, for push URLs of a remote without
191
+ * `pushurl`, by `url.<base>.pushInsteadOf`), as git reads them.
192
+ *
193
+ * @example
194
+ * ```typescript
195
+ * const [url] = await git.remoteGetUrl().setRemoteName("origin").call();
196
+ * const pushUrls = await git.remoteGetUrl().setRemoteName("origin").setPush(true).setAll(true).call();
197
+ * ```
198
+ */
199
+ export declare class RemoteGetUrlCommand extends GitCommand<string[]> {
200
+ private remoteName?;
201
+ private push;
202
+ private all;
203
+ /** Set the remote whose URL is read. */
204
+ setRemoteName(name: string): this;
205
+ /** Read the push URLs (`--push`). */
206
+ setPush(push: boolean): this;
207
+ /** Every URL (`--all`), not only the first. */
208
+ setAll(all: boolean): this;
209
+ /**
210
+ * @returns the first URL, or with {@link setAll} every one
211
+ * @throws RemoteNotFoundError (exit 2) when the remote has no configuration (git: "No such
212
+ * remote '<name>'")
213
+ */
214
+ call(): Promise<string[]>;
215
+ }
185
216
  /**
186
217
  * Set URL for a remote.
187
218
  *
@@ -1 +1 @@
1
- {"version":3,"file":"remote-command.d.ts","sourceRoot":"","sources":["../../src/commands/remote-command.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAKL,KAAK,YAAY,EAElB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAE3D,YAAY,EAAE,YAAY,EAAE,CAAC;AAE7B;;;;;;;;;;;;;;;;;;;GAmBG;AACH,qBAAa,gBAAiB,SAAQ,UAAU,CAAC,YAAY,CAAC;IAC5D,OAAO,CAAC,IAAI,CAAC,CAAS;IACtB,OAAO,CAAC,GAAG,CAAC,CAAS;IACrB,OAAO,CAAC,YAAY,CAAC,CAAS;IAE9B;;;;OAIG;IACH,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAI1B;IAED;;OAEG;IACH,OAAO,IAAI,MAAM,GAAG,SAAS,CAE5B;IAED;;;;OAIG;IACH,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAIxB;IAED;;OAEG;IACH,MAAM,IAAI,MAAM,GAAG,SAAS,CAE3B;IAED;;;;;;OAMG;IACH,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAIrC;IAED;;;;;OAKG;IACG,IAAI,IAAI,OAAO,CAAC,YAAY,CAAC,CA8BlC;IAED,sDAAsD;YACxC,eAA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+EAA+E;IAC/E,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAI9B;IAED,wDAAwD;IACxD,SAAS,CAAC,UAAU,EAAE,OAAO,GAAG,IAAI,CAInC;IAED;;;;OAIG;IACH,WAAW,IAAI,MAAM,EAAE,CAEtB;IAED,6EAA6E;IAC7E,OAAO,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,CAI3B;IAED;;;;;;OAMG;IACG,IAAI,IAAI,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CA+CxC;IAED;;;;OAIG;YACW,WAAW;CAkB1B"}
@@ -0,0 +1,120 @@
1
+ /**
2
+ * How a remote command reaches a remote, as git's `transport_get` and `git_connect` decide:
3
+ * the URL (already rewritten by `url.<base>.insteadOf`, see `RemoteConfigStore`) is checked
4
+ * against `protocol.allow`; a path or `file://` URL is git's local transport (served in
5
+ * process, see `local-transport.ts`); anything else goes to the connector the transport
6
+ * registry names for it (smart HTTP by default).
7
+ */
8
+ import { type Credentials, type GitConnectRequest, type GitService, type GitSession, type GitTransportConnector, type GitTransportRegistry, type GitUrl, type ReceivePackConnection, type UploadPackConnection } from "@statewalker/vcs-transport";
9
+ import type { GitHostEnvironment, OpenedRepository, WorkingCopy } from "@statewalker/vcs-working-tree";
10
+ import { RemoteConfigStore } from "../remote-config/index.js";
11
+ import type { HookSession } from "./git-hooks.js";
12
+ /** A remote URL resolved to the transport that reaches it. */
13
+ export type ResolvedRemote = {
14
+ kind: "local";
15
+ /** The URL as given (rewritten) */
16
+ url: string;
17
+ /** The repository's path, as git reports it (`file://` stripped and decoded) */
18
+ path: string;
19
+ } | {
20
+ kind: "connector";
21
+ url: string;
22
+ parsed: GitUrl;
23
+ connector: GitTransportConnector;
24
+ };
25
+ /** A resolved remote, its local repository opened. */
26
+ export type PreparedRemote = (Extract<ResolvedRemote, {
27
+ kind: "local";
28
+ }> & {
29
+ repository: OpenedRepository;
30
+ }) | Extract<ResolvedRemote, {
31
+ kind: "connector";
32
+ }>;
33
+ /** What {@link resolveRemote} reads: the configuration, the environment and the registry. */
34
+ export interface RemoteResolutionContext {
35
+ /** `protocol.*` settings */
36
+ config: RemoteConfigStore;
37
+ /** `GIT_PROTOCOL_FROM_USER`, `GIT_ALLOW_PROTOCOL` */
38
+ environment?: GitHostEnvironment;
39
+ transports: GitTransportRegistry;
40
+ }
41
+ /**
42
+ * transport.c's `is_transport_allowed`: `GIT_ALLOW_PROTOCOL` when set (the only transports
43
+ * allowed); else `protocol.<type>.allow`, then `protocol.allow`, then git's defaults (http,
44
+ * https, git and ssh always; ext never; any other, `file` included, only when
45
+ * `GIT_PROTOCOL_FROM_USER` is not false).
46
+ *
47
+ * @example
48
+ * ```ts
49
+ * isTransportAllowed("ext", store); // false
50
+ * isTransportAllowed("file", store, { protocolFromUser: false } as GitHostEnvironment); // false
51
+ * ```
52
+ */
53
+ export declare function isTransportAllowed(type: string, config: RemoteConfigStore, environment?: GitHostEnvironment): boolean;
54
+ /** transport.c's `transport_check_allowed`: git's "transport '<type>' not allowed". */
55
+ export declare function checkTransportAllowed(type: string, config: RemoteConfigStore, environment?: GitHostEnvironment): void;
56
+ /**
57
+ * `protocol.version` (git's `get_protocol_version_config`): 0, 1 or 2, default 2; any other
58
+ * value is git's "unknown value for config 'protocol.version'".
59
+ */
60
+ export declare function protocolVersionOf(config: RemoteConfigStore): 0 | 1 | 2;
61
+ /**
62
+ * Resolves a remote URL (already rewritten by `insteadOf`) to its transport, in git's order
63
+ * (transport_get, then git_connect): a `<helper>::<address>` URL goes to the connector for
64
+ * the helper; `rsync:` is refused; a path or `file://` URL is the local transport (its path
65
+ * checked first, then `protocol.file.allow`); `ssh`/`git` URLs (path, then
66
+ * `protocol.<scheme>.allow`) and any other `<scheme>://` (`protocol.<scheme>.allow`) go to
67
+ * the registry's connector. Without one, git's words: "unable to find remote helper" where
68
+ * git would run a remote helper, ours for ssh and git:// (git would connect directly).
69
+ *
70
+ * @throws TransportError git's lines (exit 128)
71
+ */
72
+ export declare function resolveRemote(url: string, context: RemoteResolutionContext): ResolvedRemote;
73
+ /**
74
+ * {@link resolveRemote}, then a local remote's repository opened (git's "does not appear to
75
+ * be a git repository" when it cannot be).
76
+ */
77
+ export declare function prepareRemote(workingCopy: WorkingCopy, url: string, transports: GitTransportRegistry): Promise<PreparedRemote>;
78
+ /** A resolved remote with its local repository opened ({@link prepareRemote}'s second half). */
79
+ export declare function openResolvedRemote(workingCopy: WorkingCopy, resolved: ResolvedRemote): Promise<PreparedRemote>;
80
+ /** The resolution context of a working copy: its configuration and host environment. */
81
+ export declare function remoteContextOf(workingCopy: WorkingCopy, transports: GitTransportRegistry): RemoteResolutionContext;
82
+ /** How a remote command talks to a remote reached through a connector. */
83
+ export interface RemoteSessionOptions {
84
+ credentials?: Credentials;
85
+ headers?: Record<string, string>;
86
+ timeout?: number;
87
+ /** Smart HTTP: gzip large fetch request bodies */
88
+ gzipRequests?: boolean;
89
+ /** Smart HTTP: stream the push request body */
90
+ streamRequestBody?: boolean;
91
+ /** `protocol.version` ({@link protocolVersionOf}) */
92
+ protocolVersion: 0 | 1 | 2;
93
+ /**
94
+ * The program the remote runs for the service (git's `--upload-pack` / `--receive-pack`,
95
+ * `remote.<name>.uploadpack` / `receivepack`); connectors that run one (ssh, git://) use it
96
+ */
97
+ program?: string;
98
+ signal?: AbortSignal;
99
+ }
100
+ /**
101
+ * Runs `run` over a session the remote's connector opens for `service` (the request's
102
+ * protocol version as git_connect asks for it: v0 for receive-pack when v2 is configured); a
103
+ * native session's stream is closed afterwards, once, whether or not `run` closed it.
104
+ */
105
+ export declare function withRemoteSession<T>(remote: Extract<ResolvedRemote, {
106
+ kind: "connector";
107
+ }>, service: GitService, options: RemoteSessionOptions, run: (session: GitSession, request: GitConnectRequest) => Promise<T>): Promise<T>;
108
+ /**
109
+ * Runs `run` over a connection to upload-pack of a remote: in process for a local one
110
+ * (`withLocalUploadPack`, protocol v2 unless `protocol.version` says otherwise), else over
111
+ * the session its connector opens (`openUploadPack`).
112
+ */
113
+ export declare function withRemoteUploadPack<T>(remote: PreparedRemote, options: RemoteSessionOptions, run: (connection: UploadPackConnection) => Promise<T>): Promise<T>;
114
+ /**
115
+ * Runs `run` over a connection to receive-pack of a remote: in process for a local one
116
+ * (`withLocalReceivePack`, with the remote repository's hooks), else over the session its
117
+ * connector opens (`openReceivePack`).
118
+ */
119
+ export declare function withRemoteReceivePack<T>(remote: PreparedRemote, options: RemoteSessionOptions, run: (connection: ReceivePackConnection) => Promise<T>, hooks?: HookSession, transactionHooks?: HookSession): Promise<T>;
120
+ //# sourceMappingURL=remote-transport.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"remote-transport.d.ts","sourceRoot":"","sources":["../../src/commands/remote-transport.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,KAAK,WAAW,EAEhB,KAAK,iBAAiB,EACtB,KAAK,UAAU,EACf,KAAK,UAAU,EACf,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,EACzB,KAAK,MAAM,EAMX,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,EAC1B,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EACV,kBAAkB,EAClB,gBAAgB,EAChB,WAAW,EACZ,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAIlD,8DAA8D;AAC9D,MAAM,MAAM,cAAc,GACtB;IACE,IAAI,EAAE,OAAO,CAAC;IACd,mCAAmC;IACnC,GAAG,EAAE,MAAM,CAAC;IACZ,gFAAgF;IAChF,IAAI,EAAE,MAAM,CAAC;CACd,GACD;IACE,IAAI,EAAE,WAAW,CAAC;IAClB,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,qBAAqB,CAAC;CAClC,CAAC;AAEN,sDAAsD;AACtD,MAAM,MA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