git-chopstick-core 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (426) hide show
  1. package/README.md +324 -32
  2. package/dist/git/add.d.ts +9 -0
  3. package/dist/git/add.js +11 -0
  4. package/dist/git/add.js.map +1 -0
  5. package/dist/git/apply.d.ts +33 -0
  6. package/dist/git/apply.js +103 -0
  7. package/dist/git/apply.js.map +1 -0
  8. package/dist/git/authentication.d.ts +5 -0
  9. package/dist/git/authentication.js +19 -0
  10. package/dist/git/authentication.js.map +1 -0
  11. package/dist/git/branch.d.ts +43 -0
  12. package/dist/git/branch.js +150 -0
  13. package/dist/git/branch.js.map +1 -0
  14. package/dist/git/checkout-index.d.ts +19 -0
  15. package/dist/git/checkout-index.js +29 -0
  16. package/dist/git/checkout-index.js.map +1 -0
  17. package/dist/git/checkout.d.ts +46 -0
  18. package/dist/git/checkout.js +126 -0
  19. package/dist/git/checkout.js.map +1 -0
  20. package/dist/git/cherry-pick.d.ts +82 -0
  21. package/dist/git/cherry-pick.js +371 -0
  22. package/dist/git/cherry-pick.js.map +1 -0
  23. package/dist/git/clean.d.ts +5 -0
  24. package/dist/git/clean.js +8 -0
  25. package/dist/git/clean.js.map +1 -0
  26. package/dist/git/clone.d.ts +22 -0
  27. package/dist/git/clone.js +58 -0
  28. package/dist/git/clone.js.map +1 -0
  29. package/dist/git/coerce-to-buffer.d.ts +1 -0
  30. package/dist/git/coerce-to-buffer.js +2 -0
  31. package/dist/git/coerce-to-buffer.js.map +1 -0
  32. package/dist/git/coerce-to-string.d.ts +1 -0
  33. package/dist/git/coerce-to-string.js +2 -0
  34. package/dist/git/coerce-to-string.js.map +1 -0
  35. package/dist/git/commit.d.ts +25 -0
  36. package/dist/git/commit.js +99 -0
  37. package/dist/git/commit.js.map +1 -0
  38. package/dist/git/config.d.ts +98 -0
  39. package/dist/git/config.js +249 -0
  40. package/dist/git/config.js.map +1 -0
  41. package/dist/git/core.d.ts +167 -0
  42. package/dist/git/core.js +368 -0
  43. package/dist/git/core.js.map +1 -0
  44. package/dist/git/create-tail-stream.d.ts +4 -0
  45. package/dist/git/create-tail-stream.js +30 -0
  46. package/dist/git/create-tail-stream.js.map +1 -0
  47. package/dist/git/credential.d.ts +5 -0
  48. package/dist/git/credential.js +64 -0
  49. package/dist/git/credential.js.map +1 -0
  50. package/dist/git/description.d.ts +5 -0
  51. package/dist/git/description.js +24 -0
  52. package/dist/git/description.js.map +1 -0
  53. package/dist/git/diff-check.d.ts +7 -0
  54. package/dist/git/diff-check.js +17 -0
  55. package/dist/git/diff-check.js.map +1 -0
  56. package/dist/git/diff-index.d.ts +31 -0
  57. package/dist/git/diff-index.js +76 -0
  58. package/dist/git/diff-index.js.map +1 -0
  59. package/dist/git/diff.d.ts +81 -0
  60. package/dist/git/diff.js +611 -0
  61. package/dist/git/diff.js.map +1 -0
  62. package/dist/git/environment.d.ts +51 -0
  63. package/dist/git/environment.js +97 -0
  64. package/dist/git/environment.js.map +1 -0
  65. package/dist/git/exec.d.ts +109 -0
  66. package/dist/git/exec.js +224 -0
  67. package/dist/git/exec.js.map +1 -0
  68. package/dist/git/fetch.d.ts +25 -0
  69. package/dist/git/fetch.js +100 -0
  70. package/dist/git/fetch.js.map +1 -0
  71. package/dist/git/for-each-ref.d.ts +13 -0
  72. package/dist/git/for-each-ref.js +114 -0
  73. package/dist/git/for-each-ref.js.map +1 -0
  74. package/dist/git/format-patch.d.ts +10 -0
  75. package/dist/git/format-patch.js +16 -0
  76. package/dist/git/format-patch.js.map +1 -0
  77. package/dist/git/git-delimiter-parser.d.ts +38 -0
  78. package/dist/git/git-delimiter-parser.js +79 -0
  79. package/dist/git/git-delimiter-parser.js.map +1 -0
  80. package/dist/git/gitignore.d.ts +26 -0
  81. package/dist/git/gitignore.js +124 -0
  82. package/dist/git/gitignore.js.map +1 -0
  83. package/dist/git/index.d.ts +46 -0
  84. package/dist/git/index.js +47 -0
  85. package/dist/git/index.js.map +1 -0
  86. package/dist/git/init.d.ts +2 -0
  87. package/dist/git/init.js +7 -0
  88. package/dist/git/init.js.map +1 -0
  89. package/dist/git/interpret-trailers.d.ts +88 -0
  90. package/dist/git/interpret-trailers.js +130 -0
  91. package/dist/git/interpret-trailers.js.map +1 -0
  92. package/dist/git/lfs.d.ts +25 -0
  93. package/dist/git/lfs.js +73 -0
  94. package/dist/git/lfs.js.map +1 -0
  95. package/dist/git/log.d.ts +56 -0
  96. package/dist/git/log.js +258 -0
  97. package/dist/git/log.js.map +1 -0
  98. package/dist/git/merge-tree.d.ts +13 -0
  99. package/dist/git/merge-tree.js +24 -0
  100. package/dist/git/merge-tree.js.map +1 -0
  101. package/dist/git/merge.d.ts +50 -0
  102. package/dist/git/merge.js +111 -0
  103. package/dist/git/merge.js.map +1 -0
  104. package/dist/git/multi-operation-terminal-output.d.ts +20 -0
  105. package/dist/git/multi-operation-terminal-output.js +56 -0
  106. package/dist/git/multi-operation-terminal-output.js.map +1 -0
  107. package/dist/git/pull.d.ts +24 -0
  108. package/dist/git/pull.js +91 -0
  109. package/dist/git/pull.js.map +1 -0
  110. package/dist/git/push-terminal-chunk.d.ts +19 -0
  111. package/dist/git/push-terminal-chunk.js +36 -0
  112. package/dist/git/push-terminal-chunk.js.map +1 -0
  113. package/dist/git/push.d.ts +42 -0
  114. package/dist/git/push.js +80 -0
  115. package/dist/git/push.js.map +1 -0
  116. package/dist/git/rebase.d.ts +119 -0
  117. package/dist/git/rebase.js +415 -0
  118. package/dist/git/rebase.js.map +1 -0
  119. package/dist/git/reflog.d.ts +14 -0
  120. package/dist/git/reflog.js +88 -0
  121. package/dist/git/reflog.js.map +1 -0
  122. package/dist/git/refs.d.ts +26 -0
  123. package/dist/git/refs.js +53 -0
  124. package/dist/git/refs.js.map +1 -0
  125. package/dist/git/remote.d.ts +31 -0
  126. package/dist/git/remote.js +81 -0
  127. package/dist/git/remote.js.map +1 -0
  128. package/dist/git/reorder.d.ts +23 -0
  129. package/dist/git/reorder.js +111 -0
  130. package/dist/git/reorder.js.map +1 -0
  131. package/dist/git/reset.d.ts +41 -0
  132. package/dist/git/reset.js +86 -0
  133. package/dist/git/reset.js.map +1 -0
  134. package/dist/git/rev-list.d.ts +67 -0
  135. package/dist/git/rev-list.js +157 -0
  136. package/dist/git/rev-list.js.map +1 -0
  137. package/dist/git/rev-parse.d.ts +24 -0
  138. package/dist/git/rev-parse.js +65 -0
  139. package/dist/git/rev-parse.js.map +1 -0
  140. package/dist/git/revert.d.ts +12 -0
  141. package/dist/git/revert.js +30 -0
  142. package/dist/git/revert.js.map +1 -0
  143. package/dist/git/rm.d.ts +12 -0
  144. package/dist/git/rm.js +22 -0
  145. package/dist/git/rm.js.map +1 -0
  146. package/dist/git/show.d.ts +42 -0
  147. package/dist/git/show.js +59 -0
  148. package/dist/git/show.js.map +1 -0
  149. package/dist/git/spawn.d.ts +18 -0
  150. package/dist/git/spawn.js +16 -0
  151. package/dist/git/spawn.js.map +1 -0
  152. package/dist/git/squash.d.ts +28 -0
  153. package/dist/git/squash.js +127 -0
  154. package/dist/git/squash.js.map +1 -0
  155. package/dist/git/stage.d.ts +21 -0
  156. package/dist/git/stage.js +72 -0
  157. package/dist/git/stage.js.map +1 -0
  158. package/dist/git/stash.d.ts +53 -0
  159. package/dist/git/stash.js +204 -0
  160. package/dist/git/stash.js.map +1 -0
  161. package/dist/git/status.d.ts +39 -0
  162. package/dist/git/status.js +293 -0
  163. package/dist/git/status.js.map +1 -0
  164. package/dist/git/submodule.d.ts +20 -0
  165. package/dist/git/submodule.js +153 -0
  166. package/dist/git/submodule.js.map +1 -0
  167. package/dist/git/tag.d.ts +32 -0
  168. package/dist/git/tag.js +101 -0
  169. package/dist/git/tag.js.map +1 -0
  170. package/dist/git/update-index.d.ts +11 -0
  171. package/dist/git/update-index.js +99 -0
  172. package/dist/git/update-index.js.map +1 -0
  173. package/dist/git/update-ref.d.ts +23 -0
  174. package/dist/git/update-ref.js +32 -0
  175. package/dist/git/update-ref.js.map +1 -0
  176. package/dist/git/var.d.ts +18 -0
  177. package/dist/git/var.js +33 -0
  178. package/dist/git/var.js.map +1 -0
  179. package/dist/git/worktree-include.d.ts +42 -0
  180. package/dist/git/worktree-include.js +109 -0
  181. package/dist/git/worktree-include.js.map +1 -0
  182. package/dist/git/worktree.d.ts +25 -0
  183. package/dist/git/worktree.js +139 -0
  184. package/dist/git/worktree.js.map +1 -0
  185. package/dist/index.d.ts +4 -0
  186. package/dist/index.js +7 -0
  187. package/dist/index.js.map +1 -0
  188. package/dist/lib/api.d.ts +2 -0
  189. package/dist/lib/api.js +7 -0
  190. package/dist/lib/api.js.map +1 -0
  191. package/dist/lib/diff-parser.d.ts +20 -0
  192. package/dist/lib/diff-parser.js +184 -0
  193. package/dist/lib/diff-parser.js.map +1 -0
  194. package/dist/lib/directory-exists.d.ts +1 -0
  195. package/dist/lib/directory-exists.js +11 -0
  196. package/dist/lib/directory-exists.js.map +1 -0
  197. package/dist/lib/errno-exception.d.ts +6 -0
  198. package/dist/lib/errno-exception.js +6 -0
  199. package/dist/lib/errno-exception.js.map +1 -0
  200. package/dist/lib/fatal-error.d.ts +4 -0
  201. package/dist/lib/fatal-error.js +18 -0
  202. package/dist/lib/fatal-error.js.map +1 -0
  203. package/dist/lib/feature-flag.d.ts +14 -0
  204. package/dist/lib/feature-flag.js +25 -0
  205. package/dist/lib/feature-flag.js.map +1 -0
  206. package/dist/lib/file-system.d.ts +1 -0
  207. package/dist/lib/file-system.js +7 -0
  208. package/dist/lib/file-system.js.map +1 -0
  209. package/dist/lib/get-old-path.d.ts +2 -0
  210. package/dist/lib/get-old-path.js +9 -0
  211. package/dist/lib/get-old-path.js.map +1 -0
  212. package/dist/lib/git/environment.d.ts +3 -0
  213. package/dist/lib/git/environment.js +7 -0
  214. package/dist/lib/git/environment.js.map +1 -0
  215. package/dist/lib/git-perf.d.ts +1 -0
  216. package/dist/lib/git-perf.js +4 -0
  217. package/dist/lib/git-perf.js.map +1 -0
  218. package/dist/lib/helpers/default-branch.d.ts +1 -0
  219. package/dist/lib/helpers/default-branch.js +4 -0
  220. package/dist/lib/helpers/default-branch.js.map +1 -0
  221. package/dist/lib/helpers/path.d.ts +1 -0
  222. package/dist/lib/helpers/path.js +5 -0
  223. package/dist/lib/helpers/path.js.map +1 -0
  224. package/dist/lib/hooks/with-hooks-env.d.ts +3 -0
  225. package/dist/lib/hooks/with-hooks-env.js +4 -0
  226. package/dist/lib/hooks/with-hooks-env.js.map +1 -0
  227. package/dist/lib/merge.d.ts +1 -0
  228. package/dist/lib/merge.js +4 -0
  229. package/dist/lib/merge.js.map +1 -0
  230. package/dist/lib/noop.d.ts +1 -0
  231. package/dist/lib/noop.js +2 -0
  232. package/dist/lib/noop.js.map +1 -0
  233. package/dist/lib/patch-formatter.d.ts +5 -0
  234. package/dist/lib/patch-formatter.js +7 -0
  235. package/dist/lib/patch-formatter.js.map +1 -0
  236. package/dist/lib/path-exists.d.ts +1 -0
  237. package/dist/lib/path-exists.js +3 -0
  238. package/dist/lib/path-exists.js.map +1 -0
  239. package/dist/lib/progress/from-process.d.ts +2 -0
  240. package/dist/lib/progress/from-process.js +4 -0
  241. package/dist/lib/progress/from-process.js.map +1 -0
  242. package/dist/lib/progress/index.d.ts +49 -0
  243. package/dist/lib/progress/index.js +32 -0
  244. package/dist/lib/progress/index.js.map +1 -0
  245. package/dist/lib/progress/revert.d.ts +8 -0
  246. package/dist/lib/progress/revert.js +15 -0
  247. package/dist/lib/progress/revert.js.map +1 -0
  248. package/dist/lib/rebase.d.ts +1 -0
  249. package/dist/lib/rebase.js +4 -0
  250. package/dist/lib/rebase.js.map +1 -0
  251. package/dist/lib/remove-remote-prefix.d.ts +1 -0
  252. package/dist/lib/remove-remote-prefix.js +5 -0
  253. package/dist/lib/remove-remote-prefix.js.map +1 -0
  254. package/dist/lib/resolve-git-proxy.d.ts +1 -0
  255. package/dist/lib/resolve-git-proxy.js +4 -0
  256. package/dist/lib/resolve-git-proxy.js.map +1 -0
  257. package/dist/lib/round.d.ts +1 -0
  258. package/dist/lib/round.js +5 -0
  259. package/dist/lib/round.js.map +1 -0
  260. package/dist/lib/split-buffer.d.ts +1 -0
  261. package/dist/lib/split-buffer.js +15 -0
  262. package/dist/lib/split-buffer.js.map +1 -0
  263. package/dist/lib/status-parser.d.ts +19 -0
  264. package/dist/lib/status-parser.js +137 -0
  265. package/dist/lib/status-parser.js.map +1 -0
  266. package/dist/lib/stores/helpers/find-default-remote.d.ts +1 -0
  267. package/dist/lib/stores/helpers/find-default-remote.js +4 -0
  268. package/dist/lib/stores/helpers/find-default-remote.js.map +1 -0
  269. package/dist/lib/trampoline/trampoline-environment.d.ts +1 -0
  270. package/dist/lib/trampoline/trampoline-environment.js +4 -0
  271. package/dist/lib/trampoline/trampoline-environment.js.map +1 -0
  272. package/dist/models/branch.d.ts +44 -0
  273. package/dist/models/branch.js +59 -0
  274. package/dist/models/branch.js.map +1 -0
  275. package/dist/models/cherry-pick.d.ts +11 -0
  276. package/dist/models/cherry-pick.js +2 -0
  277. package/dist/models/cherry-pick.js.map +1 -0
  278. package/dist/models/clone-options.d.ts +6 -0
  279. package/dist/models/clone-options.js +2 -0
  280. package/dist/models/clone-options.js.map +1 -0
  281. package/dist/models/commit-identity.d.ts +9 -0
  282. package/dist/models/commit-identity.js +34 -0
  283. package/dist/models/commit-identity.js.map +1 -0
  284. package/dist/models/commit.d.ts +30 -0
  285. package/dist/models/commit.js +32 -0
  286. package/dist/models/commit.js.map +1 -0
  287. package/dist/models/computed-action.d.ts +6 -0
  288. package/dist/models/computed-action.js +8 -0
  289. package/dist/models/computed-action.js.map +1 -0
  290. package/dist/models/diff/diff-data.d.ts +53 -0
  291. package/dist/models/diff/diff-data.js +19 -0
  292. package/dist/models/diff/diff-data.js.map +1 -0
  293. package/dist/models/diff/diff-line.d.ts +18 -0
  294. package/dist/models/diff/diff-line.js +33 -0
  295. package/dist/models/diff/diff-line.js.map +1 -0
  296. package/dist/models/diff/diff-selection.d.ts +22 -0
  297. package/dist/models/diff/diff-selection.js +127 -0
  298. package/dist/models/diff/diff-selection.js.map +1 -0
  299. package/dist/models/diff/image-diff.d.ts +6 -0
  300. package/dist/models/diff/image-diff.js +8 -0
  301. package/dist/models/diff/image-diff.js.map +1 -0
  302. package/dist/models/diff/image.d.ts +7 -0
  303. package/dist/models/diff/image.js +13 -0
  304. package/dist/models/diff/image.js.map +1 -0
  305. package/dist/models/diff/index.d.ts +6 -0
  306. package/dist/models/diff/index.js +7 -0
  307. package/dist/models/diff/index.js.map +1 -0
  308. package/dist/models/diff/raw-diff.d.ts +32 -0
  309. package/dist/models/diff/raw-diff.js +38 -0
  310. package/dist/models/diff/raw-diff.js.map +1 -0
  311. package/dist/models/git-author.d.ts +7 -0
  312. package/dist/models/git-author.js +18 -0
  313. package/dist/models/git-author.js.map +1 -0
  314. package/dist/models/index.d.ts +21 -0
  315. package/dist/models/index.js +20 -0
  316. package/dist/models/index.js.map +1 -0
  317. package/dist/models/manual-conflict-resolution.d.ts +4 -0
  318. package/dist/models/manual-conflict-resolution.js +6 -0
  319. package/dist/models/manual-conflict-resolution.js.map +1 -0
  320. package/dist/models/merge.d.ts +6 -0
  321. package/dist/models/merge.js +2 -0
  322. package/dist/models/merge.js.map +1 -0
  323. package/dist/models/multi-commit-operation.d.ts +6 -0
  324. package/dist/models/multi-commit-operation.js +8 -0
  325. package/dist/models/multi-commit-operation.js.map +1 -0
  326. package/dist/models/progress.d.ts +41 -0
  327. package/dist/models/progress.js +7 -0
  328. package/dist/models/progress.js.map +1 -0
  329. package/dist/models/rebase.d.ts +17 -0
  330. package/dist/models/rebase.js +8 -0
  331. package/dist/models/rebase.js.map +1 -0
  332. package/dist/models/remote.d.ts +5 -0
  333. package/dist/models/remote.js +8 -0
  334. package/dist/models/remote.js.map +1 -0
  335. package/dist/models/repository.d.ts +7 -0
  336. package/dist/models/repository.js +15 -0
  337. package/dist/models/repository.js.map +1 -0
  338. package/dist/models/stash-entry.d.ts +20 -0
  339. package/dist/models/stash-entry.js +7 -0
  340. package/dist/models/stash-entry.js.map +1 -0
  341. package/dist/models/status.d.ts +166 -0
  342. package/dist/models/status.js +135 -0
  343. package/dist/models/status.js.map +1 -0
  344. package/dist/models/submodule.d.ts +12 -0
  345. package/dist/models/submodule.js +2 -0
  346. package/dist/models/submodule.js.map +1 -0
  347. package/dist/models/worktree.d.ts +10 -0
  348. package/dist/models/worktree.js +2 -0
  349. package/dist/models/worktree.js.map +1 -0
  350. package/package.json +13 -4
  351. package/src/git/add.ts +3 -3
  352. package/src/git/apply.ts +8 -8
  353. package/src/git/authentication.ts +3 -2
  354. package/src/git/branch.ts +10 -10
  355. package/src/git/checkout-index.ts +2 -2
  356. package/src/git/checkout.ts +12 -12
  357. package/src/git/cherry-pick.ts +16 -16
  358. package/src/git/clean.ts +2 -2
  359. package/src/git/clone.ts +6 -6
  360. package/src/git/commit.ts +7 -7
  361. package/src/git/config.ts +2 -2
  362. package/src/git/core.ts +8 -8
  363. package/src/git/credential.ts +1 -1
  364. package/src/git/diff-check.ts +1 -1
  365. package/src/git/diff-index.ts +2 -2
  366. package/src/git/diff.ts +18 -18
  367. package/src/git/environment.ts +5 -5
  368. package/src/git/fetch.ts +7 -7
  369. package/src/git/for-each-ref.ts +5 -5
  370. package/src/git/format-patch.ts +3 -3
  371. package/src/git/git-delimiter-parser.ts +1 -1
  372. package/src/git/gitignore.ts +2 -2
  373. package/src/git/index.ts +46 -36
  374. package/src/git/init.ts +2 -2
  375. package/src/git/interpret-trailers.ts +3 -3
  376. package/src/git/lfs.ts +2 -2
  377. package/src/git/log.ts +8 -8
  378. package/src/git/merge-tree.ts +5 -5
  379. package/src/git/merge.ts +5 -5
  380. package/src/git/multi-operation-terminal-output.ts +3 -3
  381. package/src/git/pull.ts +7 -7
  382. package/src/git/push-terminal-chunk.ts +1 -1
  383. package/src/git/push.ts +7 -7
  384. package/src/git/rebase.ts +16 -16
  385. package/src/git/reflog.ts +2 -2
  386. package/src/git/refs.ts +2 -2
  387. package/src/git/remote.ts +6 -6
  388. package/src/git/reorder.ts +7 -7
  389. package/src/git/reset.ts +3 -3
  390. package/src/git/rev-list.ts +5 -5
  391. package/src/git/rev-parse.ts +2 -2
  392. package/src/git/revert.ts +8 -8
  393. package/src/git/rm.ts +3 -3
  394. package/src/git/show.ts +4 -4
  395. package/src/git/spawn.ts +3 -3
  396. package/src/git/squash.ts +7 -7
  397. package/src/git/stage.ts +7 -7
  398. package/src/git/stash.ts +10 -10
  399. package/src/git/status.ts +13 -13
  400. package/src/git/submodule.ts +9 -9
  401. package/src/git/tag.ts +4 -4
  402. package/src/git/update-index.ts +5 -5
  403. package/src/git/update-ref.ts +2 -2
  404. package/src/git/var.ts +3 -3
  405. package/src/git/worktree-include.ts +3 -3
  406. package/src/git/worktree.ts +4 -4
  407. package/src/index.ts +9 -21
  408. package/src/lib/diff-parser.ts +2 -2
  409. package/src/lib/get-old-path.ts +1 -1
  410. package/src/lib/git/environment.ts +1 -1
  411. package/src/lib/patch-formatter.ts +3 -3
  412. package/src/lib/progress/from-process.ts +1 -1
  413. package/src/lib/progress/index.ts +1 -1
  414. package/src/lib/status-parser.ts +2 -2
  415. package/src/models/branch.ts +1 -1
  416. package/src/models/cherry-pick.ts +2 -2
  417. package/src/models/commit.ts +1 -1
  418. package/src/models/diff/diff-data.ts +3 -3
  419. package/src/models/diff/index.ts +6 -6
  420. package/src/models/diff/raw-diff.ts +1 -1
  421. package/src/models/index.ts +36 -0
  422. package/src/models/rebase.ts +2 -2
  423. package/src/models/stash-entry.ts +1 -1
  424. package/src/models/status.ts +1 -1
  425. package/examples/get-status.ts +0 -84
  426. package/tsconfig.json +0 -17
@@ -0,0 +1,153 @@
1
+ import { git } from './core.js';
2
+ import { pathExists } from '../lib/path-exists.js';
3
+ import { executionOptionsWithProgress } from '../lib/progress/index.js';
4
+ import { envForRemoteOperation, getFallbackUrlForProxyResolve, } from './environment.js';
5
+ import { AuthenticationErrors } from './authentication.js';
6
+ import { join, resolve } from 'path';
7
+ import { readFile } from 'fs/promises';
8
+ /**
9
+ * Update submodules after a git operation.
10
+ *
11
+ * @param repository - The repository in which to update submodules
12
+ * @param remote - The remote for environment setup (can be null)
13
+ * @param progressCallback - An optional function which will be invoked
14
+ * with information about the current progress
15
+ * of the submodule update operation.
16
+ * @param progressKind - The kind of progress event ('checkout', 'pull', etc.)
17
+ * @param title - The title to use for progress reporting
18
+ * @param targetOrRemote - The target (for checkout) or remote name (for pull)
19
+ * @param allowFileProtocol - Whether to allow file:// protocol for submodules
20
+ */
21
+ export async function updateSubmodulesAfterOperation(repository, remote, progressCallback, progressKind, title, targetOrRemote, allowFileProtocol) {
22
+ const opts = {
23
+ env: await envForRemoteOperation(getFallbackUrlForProxyResolve(repository, remote)),
24
+ expectedErrors: AuthenticationErrors,
25
+ };
26
+ const args = [
27
+ ...(allowFileProtocol ? ['-c', 'protocol.file.allow=always'] : []),
28
+ 'submodule',
29
+ 'update',
30
+ '--init',
31
+ '--recursive',
32
+ ];
33
+ if (!progressCallback) {
34
+ await git(args, repository.path, 'updateSubmodules', opts);
35
+ return;
36
+ }
37
+ // Initial progress
38
+ progressCallback({
39
+ kind: progressKind,
40
+ title,
41
+ description: 'Updating submodules',
42
+ value: 0,
43
+ // Add the target or remote field based on the progress kind
44
+ ...(progressKind === 'checkout'
45
+ ? { target: targetOrRemote }
46
+ : { remote: targetOrRemote }),
47
+ });
48
+ let submoduleEventCount = 0;
49
+ const progressOpts = await executionOptionsWithProgress({ ...opts, trackLFSProgress: true }, {
50
+ parse(line) {
51
+ if (line.match(/^Submodule path (.)+?: checked out /) ||
52
+ line.startsWith('Cloning into ')) {
53
+ submoduleEventCount += 1;
54
+ }
55
+ return {
56
+ kind: 'context',
57
+ text: `Updating submodules: ${line}`,
58
+ // Math taken from https://math.stackexchange.com/a/2323106
59
+ // We do this to fake a progress that slows down as we process more
60
+ // events, as we don't know how many submodules there are upfront, or
61
+ // what does git have to do with them (cloning, just checking them
62
+ // out...)
63
+ percent: 1 - Math.exp(-submoduleEventCount * 0.25),
64
+ };
65
+ },
66
+ }, progress => {
67
+ const description = progress.kind === 'progress' ? progress.details.text : progress.text;
68
+ const value = progress.percent;
69
+ progressCallback({
70
+ kind: progressKind,
71
+ title,
72
+ description,
73
+ value,
74
+ ...(progressKind === 'checkout'
75
+ ? { target: targetOrRemote }
76
+ : { remote: targetOrRemote }),
77
+ });
78
+ });
79
+ await git(args, repository.path, 'updateSubmodules', progressOpts);
80
+ // Final progress
81
+ progressCallback({
82
+ kind: progressKind,
83
+ title,
84
+ description: 'Submodules updated',
85
+ value: 1,
86
+ ...(progressKind === 'checkout'
87
+ ? { target: targetOrRemote }
88
+ : { remote: targetOrRemote }),
89
+ });
90
+ }
91
+ export async function listSubmodules(repository) {
92
+ const [submodulesFile, submodulesDir] = await Promise.all([
93
+ pathExists(join(repository.path, '.gitmodules')),
94
+ pathExists(join(repository.path, '.git', 'modules')),
95
+ ]);
96
+ if (!submodulesFile && !submodulesDir) {
97
+ // repo path + .gitmodules and + .git/modules covers the vast majority of
98
+ // "normal" repositories but if we're in a linked worktree the modules
99
+ // directory is actually in the git common dir so we'll also check for the
100
+ // existence of the modules directory there as well before giving up on the
101
+ // existence of submodules in this repo. We're reading the commondir file
102
+ // ourselves here instead of calling out to git to avoid the cost of
103
+ // spawning a process on Windows
104
+ const commonDirPath = join(repository.resolvedGitDir, 'commondir');
105
+ const commonDir = await readFile(commonDirPath, 'utf8')
106
+ .then(content => content.replace(/\r?\n$/, ''))
107
+ .then(p => (p ? resolve(repository.resolvedGitDir, p) : null))
108
+ .catch(() => null);
109
+ if (!commonDir || !(await pathExists(join(commonDir, 'modules')))) {
110
+ console.info('No submodules found. Skipping "git submodule status"');
111
+ return [];
112
+ }
113
+ }
114
+ // We don't recurse when listing submodules here because we don't have a good
115
+ // story about managing these currently. So for now we're only listing
116
+ // changes to the top-level submodules to be consistent with `git status`
117
+ const { stdout, exitCode } = await git(['submodule', 'status', '--'], repository.path, 'listSubmodules', { successExitCodes: new Set([0, 128]) });
118
+ if (exitCode === 128) {
119
+ // unable to parse submodules in repository, giving up
120
+ return [];
121
+ }
122
+ const submodules = new Array();
123
+ // entries are of the format:
124
+ // 1eaabe34fc6f486367a176207420378f587d3b48 git (v2.16.0-rc0)
125
+ //
126
+ // first character:
127
+ // - " " if no change
128
+ // - "-" if the submodule is not initialized
129
+ // - "+" if the currently checked out submodule commit does not match the SHA-1 found in the index of the containing repository
130
+ // - "U" if the submodule has merge conflicts
131
+ //
132
+ // then the 40-character SHA represents the current commit
133
+ //
134
+ // then the path to the submodule
135
+ //
136
+ // then the output of `git describe` for the submodule in braces
137
+ // we're not leveraging this in the app, so go and read the docs
138
+ // about it if you want to learn more:
139
+ //
140
+ // https://git-scm.com/docs/git-describe
141
+ const statusRe = /^.([^ ]+) (.+) \((.+?)\)$/gm;
142
+ for (const [, sha, path, describe] of stdout.matchAll(statusRe)) {
143
+ submodules.push({ path, url: '', describe, sha, status: { commitChanged: false, modifiedChanges: false, untrackedChanges: false } });
144
+ }
145
+ return submodules;
146
+ }
147
+ export async function resetSubmodulePaths(repository, paths) {
148
+ if (paths.length === 0) {
149
+ return;
150
+ }
151
+ await git(['submodule', 'update', '--recursive', '--force', '--', ...paths], repository.path, 'updateSubmodule');
152
+ }
153
+ //# sourceMappingURL=submodule.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"submodule.js","sourceRoot":"","sources":["../../src/git/submodule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAA8B,MAAM,WAAW,CAAA;AAG3D,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AAClD,OAAO,EAAE,4BAA4B,EAAc,MAAM,0BAA0B,CAAA;AACnF,OAAO,EACL,qBAAqB,EACrB,6BAA6B,GAC9B,MAAM,kBAAkB,CAAA;AACzB,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAA;AAG1D,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,MAAM,CAA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,IAAI,EACf,iBAAiB,CAClB,CAAA;AACH,CAAC"}
@@ -0,0 +1,32 @@
1
+ import { Repository } from '../models/repository.js';
2
+ import { IRemote } from '../models/remote.js';
3
+ /**
4
+ * Create a new tag on the given target commit.
5
+ *
6
+ * @param repository - The repository in which to create the new tag.
7
+ * @param name - The name of the new tag.
8
+ * @param targetCommitSha - The SHA of the commit where the new tag will live on.
9
+ */
10
+ export declare function createTag(repository: Repository, name: string, targetCommitSha: string): Promise<void>;
11
+ /**
12
+ * Delete a tag.
13
+ *
14
+ * @param repository - The repository in which to create the new tag.
15
+ * @param name - The name of the tag to delete.
16
+ */
17
+ export declare function deleteTag(repository: Repository, name: string): Promise<void>;
18
+ /**
19
+ * Gets all the local tags. Returns a Map with the tag name and the commit it points to.
20
+ *
21
+ * @param repository The repository in which to get all the tags from.
22
+ */
23
+ export declare function getAllTags(repository: Repository): Promise<Map<string, string>>;
24
+ /**
25
+ * Fetches the tags that will get pushed to the remote repository (it does a network request).
26
+ *
27
+ * @param repository - The repository in which to check for unpushed tags
28
+ * @param account - The account to use when authenticating with the remote
29
+ * @param remote - The remote to check for unpushed tags
30
+ * @param branchName - The branch that will be used on the push command
31
+ */
32
+ export declare function fetchTagsToPush(repository: Repository, remote: IRemote, branchName: string): Promise<ReadonlyArray<string>>;
@@ -0,0 +1,101 @@
1
+ import { git } from './core.js';
2
+ import { envForRemoteOperation } from './environment.js';
3
+ /**
4
+ * Create a new tag on the given target commit.
5
+ *
6
+ * @param repository - The repository in which to create the new tag.
7
+ * @param name - The name of the new tag.
8
+ * @param targetCommitSha - The SHA of the commit where the new tag will live on.
9
+ */
10
+ export async function createTag(repository, name, targetCommitSha) {
11
+ const args = ['tag', '-a', '-m', '', name, targetCommitSha];
12
+ await git(args, repository.path, 'createTag');
13
+ }
14
+ /**
15
+ * Delete a tag.
16
+ *
17
+ * @param repository - The repository in which to create the new tag.
18
+ * @param name - The name of the tag to delete.
19
+ */
20
+ export async function deleteTag(repository, name) {
21
+ const args = ['tag', '-d', name];
22
+ await git(args, repository.path, 'deleteTag');
23
+ }
24
+ /**
25
+ * Gets all the local tags. Returns a Map with the tag name and the commit it points to.
26
+ *
27
+ * @param repository The repository in which to get all the tags from.
28
+ */
29
+ export async function getAllTags(repository) {
30
+ const args = ['show-ref', '--tags', '-d'];
31
+ const tags = await git(args, repository.path, 'getAllTags', {
32
+ successExitCodes: new Set([0, 1]), // when there are no tags, git exits with 1.
33
+ });
34
+ const tagsArray = tags.stdout
35
+ .split('\n')
36
+ .filter(line => line !== '')
37
+ .map(line => {
38
+ const [commitSha, rawTagName] = line.split(' ');
39
+ // Normalize tag names by removing the leading ref/tags/ and the trailing ^{}.
40
+ //
41
+ // git show-ref returns two entries for annotated tags:
42
+ // deadbeef refs/tags/annotated-tag
43
+ // de510b99 refs/tags/annotated-tag^{}
44
+ //
45
+ // The first entry sha correspond to the blob object of the annotation, while the second
46
+ // entry corresponds to the actual commit where the tag was created.
47
+ // By normalizing the tag name we can make sure that the commit sha gets stored in the returned
48
+ // Map of commits (since git will always print the entry with the commit sha at the end).
49
+ const tagName = rawTagName
50
+ .replace(/^refs\/tags\//, '')
51
+ .replace(/\^\{\}$/, '');
52
+ return [tagName, commitSha];
53
+ });
54
+ return new Map(tagsArray);
55
+ }
56
+ /**
57
+ * Fetches the tags that will get pushed to the remote repository (it does a network request).
58
+ *
59
+ * @param repository - The repository in which to check for unpushed tags
60
+ * @param account - The account to use when authenticating with the remote
61
+ * @param remote - The remote to check for unpushed tags
62
+ * @param branchName - The branch that will be used on the push command
63
+ */
64
+ export async function fetchTagsToPush(repository, remote, branchName) {
65
+ const args = [
66
+ 'push',
67
+ remote.name,
68
+ branchName,
69
+ '--follow-tags',
70
+ '--dry-run',
71
+ '--no-verify',
72
+ '--porcelain',
73
+ ];
74
+ const result = await git(args, repository.path, 'fetchTagsToPush', {
75
+ env: await envForRemoteOperation(remote.url),
76
+ successExitCodes: new Set([0, 1, 128]),
77
+ });
78
+ if (result.exitCode !== 0 && result.exitCode !== 1) {
79
+ // Only when the exit code of git is 0 or 1, its stdout is parseable.
80
+ // In other cases, we just rethrow the error so our memoization layer
81
+ // doesn't cache it indefinitely.
82
+ throw result.gitError;
83
+ }
84
+ const lines = result.stdout.split('\n');
85
+ let currentLine = 1;
86
+ const unpushedTags = [];
87
+ // the last line of this porcelain command is always 'Done'
88
+ while (currentLine < lines.length && lines[currentLine] !== 'Done') {
89
+ const line = lines[currentLine];
90
+ const parts = line.split('\t');
91
+ if (parts[0] === '*' && parts[2] === '[new tag]') {
92
+ const [tagName] = parts[1].split(':');
93
+ if (tagName !== undefined) {
94
+ unpushedTags.push(tagName.replace(/^refs\/tags\//, ''));
95
+ }
96
+ }
97
+ currentLine++;
98
+ }
99
+ return unpushedTags;
100
+ }
101
+ //# sourceMappingURL=tag.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tag.js","sourceRoot":"","sources":["../../src/git/tag.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAA;AAG/B,OAAO,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAA;AAExD;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,SAAS,CAC7B,UAAsB,EACtB,IAAY,EACZ,eAAuB;IAEvB,MAAM,IAAI,GAAG,CAAC,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,eAAe,CAAC,CAAA;IAE3D,MAAM,GAAG,CAAC,IAAI,EAAE,UAAU,CAAC,IAAI,EAAE,WAAW,CAAC,CAAA;AAC/C,CAAC;AAED;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,SAAS,CAC7B,UAAsB,EACtB,IAAY;IAEZ,MAAM,IAAI,GAAG,CAAC,KAAK,EAAE,IAAI,EAAE,IAAI,CAAC,CAAA;IAEhC,MAAM,GAAG,CAAC,IAAI,EAAE,UAAU,CAAC,IAAI,EAAE,WAAW,CAAC,CAAA;AAC/C,CAAC;A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AAC"}
@@ -0,0 +1,11 @@
1
+ import { Repository } from '../models/repository.js';
2
+ import { WorkingDirectoryFileChange } from '../models/status.js';
3
+ /**
4
+ * Stage all the given files by either staging the entire path or by applying
5
+ * a patch.
6
+ *
7
+ * Note that prior to stageFiles the index has been completely reset,
8
+ * the job of this function is to set up the index in such a way that it
9
+ * reflects what the user has selected in the app.
10
+ */
11
+ export declare function stageFiles(repository: Repository, files: ReadonlyArray<WorkingDirectoryFileChange>): Promise<void>;
@@ -0,0 +1,99 @@
1
+ import { git } from './core.js';
2
+ import { DiffSelectionType } from '../models/diff/index.js';
3
+ import { applyPatchToIndex } from './apply.js';
4
+ import { AppFileStatusKind, } from '../models/status.js';
5
+ /**
6
+ * Updates the index with file contents from the working tree. This method
7
+ * is a noop when no paths are provided.
8
+ *
9
+ * @param paths A list of paths which are to be updated with file contents and
10
+ * status from the working directory.
11
+ *
12
+ * @param options See the IUpdateIndexOptions interface for more details.
13
+ */
14
+ async function updateIndex(repository, paths, options = {}) {
15
+ if (paths.length === 0) {
16
+ return;
17
+ }
18
+ const args = ['update-index'];
19
+ if (options.add !== false) {
20
+ args.push('--add');
21
+ }
22
+ if (options.remove !== false || options.forceRemove === true) {
23
+ args.push('--remove');
24
+ }
25
+ if (options.forceRemove) {
26
+ args.push('--force-remove');
27
+ }
28
+ if (options.replace !== false) {
29
+ args.push('--replace');
30
+ }
31
+ args.push('-z', '--stdin');
32
+ await git(args, repository.path, 'updateIndex', {
33
+ stdin: paths.join('\0'),
34
+ });
35
+ }
36
+ /**
37
+ * Stage all the given files by either staging the entire path or by applying
38
+ * a patch.
39
+ *
40
+ * Note that prior to stageFiles the index has been completely reset,
41
+ * the job of this function is to set up the index in such a way that it
42
+ * reflects what the user has selected in the app.
43
+ */
44
+ export async function stageFiles(repository, files) {
45
+ const normal = [];
46
+ const oldRenamed = [];
47
+ const partial = [];
48
+ const deletedFiles = [];
49
+ for (const file of files) {
50
+ if (file.selection.getSelectionType() === DiffSelectionType.All) {
51
+ normal.push(file.path);
52
+ if (file.status.kind === AppFileStatusKind.Renamed) {
53
+ oldRenamed.push(file.status.oldPath);
54
+ }
55
+ else if (file.status.kind === AppFileStatusKind.Deleted) {
56
+ deletedFiles.push(file.path);
57
+ }
58
+ }
59
+ else {
60
+ partial.push(file);
61
+ }
62
+ }
63
+ // Staging files happens in three steps.
64
+ //
65
+ // In the first step we run through all of the renamed files, or
66
+ // more specifically the source files (old) that were renamed and
67
+ // forcefully remove them from the index. We do this in order to handle
68
+ // the scenario where a file has been renamed and a new file has been
69
+ // created in its original position. Think of it like this
70
+ //
71
+ // $ touch foo && git add foo && git commit -m 'foo'
72
+ // $ git mv foo bar
73
+ // $ echo "I'm a new foo" > foo
74
+ //
75
+ // Now we have a file which is of type Renamed that has its path set
76
+ // to 'bar' and its oldPath set to 'foo'. But there's a new file called
77
+ // foo in the repository. So if the user selects the 'foo -> bar' change
78
+ // but not the new 'foo' file for inclusion in this commit we don't
79
+ // want to add the new 'foo', we just want to recreate the move in the
80
+ // index. We do this by forcefully removing the old path from the index
81
+ // and then later (in step 2) stage the new file.
82
+ await updateIndex(repository, oldRenamed, { forceRemove: true });
83
+ // In the second step we update the index to match
84
+ // the working directory in the case of new, modified, deleted,
85
+ // and copied files as well as the destination paths for renamed
86
+ // paths.
87
+ await updateIndex(repository, normal);
88
+ // This third step will only happen if we have files that have been marked
89
+ // for deletion. This covers us for files that were blown away in the last
90
+ // updateIndex call
91
+ await updateIndex(repository, deletedFiles, { forceRemove: true });
92
+ // Finally we run through all files that have partial selections.
93
+ // We don't care about renamed or not here since applyPatchToIndex
94
+ // has logic to support that scenario.
95
+ for (const file of partial) {
96
+ await applyPatchToIndex(repository, file);
97
+ }
98
+ }
99
+ //# sourceMappingURL=update-index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update-index.js","sourceRoot":"","sources":["../../src/git/update-index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAA;AAE/B,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AAY,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC,CAAA;IAElE,iEAAiE;IACjE,kEAAkE;IAClE,sCAAsC;IACtC,KAAK,MAAM,IAAI,IAAI,OAAO,EAAE,CAAC;QAC3B,MAAM,iBAAiB,CAAC,UAAU,EAAE,IAAI,CAAC,CAAA;IAC3C,CAAC;AACH,CAAC"}
@@ -0,0 +1,23 @@
1
+ import { Repository } from '../models/repository.js';
2
+ /**
3
+ * Update the ref to a new value.
4
+ *
5
+ * @param repository - The repository in which the ref exists.
6
+ * @param ref - The ref to update. Must be fully qualified
7
+ * (e.g., `refs/heads/NAME`).
8
+ * @param oldValue - The value we expect the ref to have currently. If it
9
+ * doesn't match, the update will be aborted.
10
+ * @param newValue - The new value for the ref.
11
+ * @param reason - The reflog entry.
12
+ */
13
+ export declare function updateRef(repository: Repository, ref: string, oldValue: string, newValue: string, reason: string): Promise<void>;
14
+ /**
15
+ * Remove a ref.
16
+ *
17
+ * @param repository - The repository in which the ref exists.
18
+ * @param ref - The ref to remove. Should be fully qualified, but may also be 'HEAD'.
19
+ * @param reason - The reflog entry (optional). Note that this is only useful when
20
+ * deleting the HEAD reference as deleting any other reference will
21
+ * implicitly delete the reflog file for that reference as well.
22
+ */
23
+ export declare function deleteRef(repository: Repository, ref: string, reason?: string): Promise<void>;
@@ -0,0 +1,32 @@
1
+ import { git } from './core.js';
2
+ /**
3
+ * Update the ref to a new value.
4
+ *
5
+ * @param repository - The repository in which the ref exists.
6
+ * @param ref - The ref to update. Must be fully qualified
7
+ * (e.g., `refs/heads/NAME`).
8
+ * @param oldValue - The value we expect the ref to have currently. If it
9
+ * doesn't match, the update will be aborted.
10
+ * @param newValue - The new value for the ref.
11
+ * @param reason - The reflog entry.
12
+ */
13
+ export async function updateRef(repository, ref, oldValue, newValue, reason) {
14
+ await git(['update-ref', ref, newValue, oldValue, '-m', reason], repository.path, 'updateRef');
15
+ }
16
+ /**
17
+ * Remove a ref.
18
+ *
19
+ * @param repository - The repository in which the ref exists.
20
+ * @param ref - The ref to remove. Should be fully qualified, but may also be 'HEAD'.
21
+ * @param reason - The reflog entry (optional). Note that this is only useful when
22
+ * deleting the HEAD reference as deleting any other reference will
23
+ * implicitly delete the reflog file for that reference as well.
24
+ */
25
+ export async function deleteRef(repository, ref, reason) {
26
+ const args = ['update-ref', '-d', ref];
27
+ if (reason !== undefined) {
28
+ args.push('-m', reason);
29
+ }
30
+ await git(args, repository.path, 'deleteRef');
31
+ }
32
+ //# sourceMappingURL=update-ref.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update-ref.js","sourceRoot":"","sources":["../../src/git/update-ref.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAA;AAG/B;;;;;;;;;;GAUG;AACH,MAAM,CAAC,KAAK,UAAU,SAAS,CAC7B,UAAsB,EACtB,GAAW,EACX,QAAgB,EAChB,QAAgB,EAChB,MAAc;IAEd,MAAM,GAAG,CACP,CAAC,YAAY,EAAE,GAAG,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,CAAC,EACrD,UAAU,CAAC,IAAI,EACf,WAAW,CACZ,CAAA;AACH,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,CAAC,KAAK,UAAU,SAAS,CAC7B,UAAsB,EACtB,GAAW,EACX,MAAe;IAEf,MAAM,IAAI,GAAG,CAAC,YAAY,EAAE,IAAI,EAAE,GAAG,CAAC,CAAA;IAEtC,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;QACzB,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,CAAA;IACzB,CAAC;IAED,MAAM,GAAG,CAAC,IAAI,EAAE,UAAU,CAAC,IAAI,EAAE,WAAW,CAAC,CAAA;AAC/C,CAAC"}
@@ -0,0 +1,18 @@
1
+ import { Repository } from '../models/repository.js';
2
+ import { CommitIdentity } from '../models/commit-identity.js';
3
+ /**
4
+ * Gets the author identity, ie the name and email which would
5
+ * have been used should a commit have been performed in this
6
+ * instance. This differs from what's stored in the user.name
7
+ * and user.email config variables in that it will match what
8
+ * Git itself will use in a commit even if there's no name or
9
+ * email configured. If no email or name is configured Git will
10
+ * attempt to come up with a suitable replacement using the
11
+ * signed-in system user and hostname.
12
+ *
13
+ * A null return value means that no name/and or email was set
14
+ * and the user.useconfigonly setting prevented Git from making
15
+ * up a user ident string. If this returns null any subsequent
16
+ * commits can be expected to fail as well.
17
+ */
18
+ export declare function getAuthorIdentity(repository: Repository): Promise<CommitIdentity | null>;
@@ -0,0 +1,33 @@
1
+ import { git } from './core.js';
2
+ import { CommitIdentity } from '../models/commit-identity.js';
3
+ /**
4
+ * Gets the author identity, ie the name and email which would
5
+ * have been used should a commit have been performed in this
6
+ * instance. This differs from what's stored in the user.name
7
+ * and user.email config variables in that it will match what
8
+ * Git itself will use in a commit even if there's no name or
9
+ * email configured. If no email or name is configured Git will
10
+ * attempt to come up with a suitable replacement using the
11
+ * signed-in system user and hostname.
12
+ *
13
+ * A null return value means that no name/and or email was set
14
+ * and the user.useconfigonly setting prevented Git from making
15
+ * up a user ident string. If this returns null any subsequent
16
+ * commits can be expected to fail as well.
17
+ */
18
+ export async function getAuthorIdentity(repository) {
19
+ const result = await git(['var', 'GIT_AUTHOR_IDENT'], repository.path, 'getAuthorIdentity', {
20
+ successExitCodes: new Set([0, 128]),
21
+ });
22
+ // If user.user.useconfigonly is set and no user.name or user.email
23
+ if (result.exitCode === 128) {
24
+ return null;
25
+ }
26
+ try {
27
+ return CommitIdentity.parseIdentity(result.stdout);
28
+ }
29
+ catch (err) {
30
+ return null;
31
+ }
32
+ }
33
+ //# sourceMappingURL=var.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"var.js","sourceRoot":"","sources":["../../src/git/var.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAA;AAE/B,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAA;AAE7D;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB,CACrC,UAAsB;IAEtB,MAAM,MAAM,GAAG,MAAM,GAAG,CACtB,CAAC,KAAK,EAAE,kBAAkB,CAAC,EAC3B,UAAU,CAAC,IAAI,EACf,mBAAmB,EACnB;QACE,gBAAgB,EAAE,IAAI,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;KACpC,CACF,CAAA;IAED,mEAAmE;IACnE,IAAI,MAAM,CAAC,QAAQ,KAAK,GAAG,EAAE,CAAC;QAC5B,OAAO,IAAI,CAAA;IACb,CAAC;IAED,IAAI,CAAC;QACH,OAAO,cAAc,CAAC,aAAa,CAAC,MAAM,CAAC,MAAM,CAAC,CAAA;IACpD,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,OAAO,IAAI,CAAA;IACb,CAAC;AACH,CAAC"}
@@ -0,0 +1,42 @@
1
+ import type { Repository } from '../models/repository.js';
2
+ import { addWorktree } from './worktree.js';
3
+ /**
4
+ * Reads the patterns from the `.worktreeinclude` file at the root of the
5
+ * given repository path.
6
+ *
7
+ * The file uses `.gitignore` syntax. Blank lines and lines starting with `#`
8
+ * are ignored.
9
+ *
10
+ * Returns an empty array if the file does not exist.
11
+ */
12
+ export declare function readWorktreeIncludePatterns(repositoryPath: string): Promise<ReadonlyArray<string>>;
13
+ /**
14
+ * Returns the list of gitignored files in `repositoryPath` that match any of
15
+ * the given patterns.
16
+ *
17
+ * Only files that are both gitignored **and** matched by a `.worktreeinclude`
18
+ * pattern are returned — tracked files are never included.
19
+ */
20
+ export declare function getIgnoredFilesMatchingPatterns(repository: Repository, patterns: ReadonlyArray<string>): Promise<ReadonlyArray<string>>;
21
+ /**
22
+ * Copies each file in `files` (relative paths) from `sourcePath` to
23
+ * `destinationPath`, preserving the directory structure.
24
+ *
25
+ * Files that cannot be copied (e.g. because they no longer exist at the
26
+ * source) are skipped silently — a failure to copy a single file never
27
+ * prevents the others from being copied.
28
+ */
29
+ export declare function copyWorktreeIncludeFiles(sourcePath: string, destinationPath: string, files: ReadonlyArray<string>): Promise<void>;
30
+ /**
31
+ * Creates a new git worktree and then copies any gitignored files listed in
32
+ * the `.worktreeinclude` file from the main worktree into the newly created
33
+ * worktree.
34
+ *
35
+ * The copy step is best-effort: failures are logged but do not prevent the
36
+ * worktree from being used.
37
+ *
38
+ * @param repository The repository to create the worktree in.
39
+ * @param path The absolute path where the new worktree should be created.
40
+ * @param options Options forwarded to `addWorktree`.
41
+ */
42
+ export declare function addWorktreeWithIncludes(repository: Repository, path: string, options?: Parameters<typeof addWorktree>[2]): Promise<void>;