@gitkraken/core-gitlens 0.2.0 → 0.3.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 (361) hide show
  1. package/CHANGELOG.md +4 -1
  2. package/dist/git/cache.d.ts +28 -4
  3. package/dist/git/cache.d.ts.map +1 -1
  4. package/dist/git/cache.js +82 -18
  5. package/dist/git/cache.js.map +1 -1
  6. package/dist/git/models/commit.d.ts.map +1 -1
  7. package/dist/git/models/commit.js.map +1 -1
  8. package/dist/git/models/reference.d.ts +31 -0
  9. package/dist/git/models/reference.d.ts.map +1 -1
  10. package/dist/git/models/remote.d.ts.map +1 -1
  11. package/dist/git/models/remote.js.map +1 -1
  12. package/dist/git/models/repository.d.ts +9 -1
  13. package/dist/git/models/repository.d.ts.map +1 -1
  14. package/dist/git/models/repository.js +19 -3
  15. package/dist/git/models/repository.js.map +1 -1
  16. package/dist/git/models/search.d.ts +2 -2
  17. package/dist/git/models/search.d.ts.map +1 -1
  18. package/dist/git/models/worktree.d.ts +4 -1
  19. package/dist/git/models/worktree.d.ts.map +1 -1
  20. package/dist/git/models/worktree.js +2 -2
  21. package/dist/git/models/worktree.js.map +1 -1
  22. package/dist/git/parsers/diffParser.d.ts.map +1 -1
  23. package/dist/git/parsers/diffParser.js.map +1 -1
  24. package/dist/git/providers/branches.d.ts +15 -4
  25. package/dist/git/providers/branches.d.ts.map +1 -1
  26. package/dist/git/providers/config.d.ts +4 -1
  27. package/dist/git/providers/config.d.ts.map +1 -1
  28. package/dist/git/providers/operations.d.ts +33 -10
  29. package/dist/git/providers/operations.d.ts.map +1 -1
  30. package/dist/git/providers/pausedOperations.d.ts +3 -1
  31. package/dist/git/providers/pausedOperations.d.ts.map +1 -1
  32. package/dist/git/providers/refs.d.ts +23 -2
  33. package/dist/git/providers/refs.d.ts.map +1 -1
  34. package/dist/git/providers/staging.d.ts +16 -0
  35. package/dist/git/providers/staging.d.ts.map +1 -1
  36. package/dist/git/providers/status.d.ts +4 -1
  37. package/dist/git/providers/status.d.ts.map +1 -1
  38. package/dist/git/remotes/azure-devops.d.ts.map +1 -1
  39. package/dist/git/remotes/azure-devops.js.map +1 -1
  40. package/dist/git/{exec.types.d.ts → run.types.d.ts} +22 -3
  41. package/dist/git/run.types.d.ts.map +1 -0
  42. package/dist/git/run.types.js +2 -0
  43. package/dist/git/run.types.js.map +1 -0
  44. package/dist/git/service.d.ts.map +1 -1
  45. package/dist/git/service.js.map +1 -1
  46. package/dist/git/utils/autolink.utils.d.ts.map +1 -1
  47. package/dist/git/utils/autolink.utils.js.map +1 -1
  48. package/dist/git/utils/blame.utils.d.ts.map +1 -1
  49. package/dist/git/utils/blame.utils.js.map +1 -1
  50. package/dist/git/utils/conflictResolution.utils.d.ts +6 -0
  51. package/dist/git/utils/conflictResolution.utils.d.ts.map +1 -0
  52. package/dist/git/utils/conflictResolution.utils.js +25 -0
  53. package/dist/git/utils/conflictResolution.utils.js.map +1 -0
  54. package/dist/git/utils/fileStatus.utils.d.ts +2 -1
  55. package/dist/git/utils/fileStatus.utils.d.ts.map +1 -1
  56. package/dist/git/utils/fileStatus.utils.js +4 -0
  57. package/dist/git/utils/fileStatus.utils.js.map +1 -1
  58. package/dist/git/utils/search.utils.d.ts.map +1 -1
  59. package/dist/git/utils/search.utils.js +3 -0
  60. package/dist/git/utils/search.utils.js.map +1 -1
  61. package/dist/git/utils/sorting.d.ts +8 -0
  62. package/dist/git/utils/sorting.d.ts.map +1 -1
  63. package/dist/git/utils/sorting.js +15 -0
  64. package/dist/git/utils/sorting.js.map +1 -1
  65. package/dist/git/utils/status.utils.d.ts.map +1 -1
  66. package/dist/git/utils/status.utils.js.map +1 -1
  67. package/dist/git/watching/classifyChange.d.ts.map +1 -1
  68. package/dist/git/watching/classifyChange.js +8 -0
  69. package/dist/git/watching/classifyChange.js.map +1 -1
  70. package/dist/git/watching/gitIgnoreFilter.js +1 -1
  71. package/dist/git/watching/gitIgnoreFilter.js.map +1 -1
  72. package/dist/git/watching/initWatcher.d.ts.map +1 -1
  73. package/dist/git/watching/initWatcher.js.map +1 -1
  74. package/dist/git/watching/watchGroup.d.ts.map +1 -1
  75. package/dist/git/watching/watchGroup.js.map +1 -1
  76. package/dist/git/watching/watchService.d.ts.map +1 -1
  77. package/dist/git/watching/watchService.js +24 -4
  78. package/dist/git/watching/watchService.js.map +1 -1
  79. package/dist/git/watching/watchSession.d.ts.map +1 -1
  80. package/dist/git/watching/watchSession.js.map +1 -1
  81. package/dist/git-cli/exec/exec.types.d.ts +1 -1
  82. package/dist/git-cli/exec/exec.types.d.ts.map +1 -1
  83. package/dist/git-cli/exec/git.d.ts +3 -3
  84. package/dist/git-cli/exec/git.d.ts.map +1 -1
  85. package/dist/git-cli/exec/git.js.map +1 -1
  86. package/dist/git-cli/exec/gitQueue.d.ts +10 -2
  87. package/dist/git-cli/exec/gitQueue.d.ts.map +1 -1
  88. package/dist/git-cli/exec/gitQueue.js +39 -12
  89. package/dist/git-cli/exec/gitQueue.js.map +1 -1
  90. package/dist/git-cli/parsers/blameParser.d.ts.map +1 -1
  91. package/dist/git-cli/parsers/blameParser.js.map +1 -1
  92. package/dist/git-cli/parsers/logParser.js.map +1 -1
  93. package/dist/git-cli/parsers/refParser.d.ts +3 -30
  94. package/dist/git-cli/parsers/refParser.d.ts.map +1 -1
  95. package/dist/git-cli/parsers/refParser.js +30 -30
  96. package/dist/git-cli/parsers/refParser.js.map +1 -1
  97. package/dist/git-cli/providers/blame.d.ts.map +1 -1
  98. package/dist/git-cli/providers/blame.js.map +1 -1
  99. package/dist/git-cli/providers/branches.d.ts +15 -5
  100. package/dist/git-cli/providers/branches.d.ts.map +1 -1
  101. package/dist/git-cli/providers/branches.js +98 -68
  102. package/dist/git-cli/providers/branches.js.map +1 -1
  103. package/dist/git-cli/providers/commits.d.ts.map +1 -1
  104. package/dist/git-cli/providers/commits.js +74 -30
  105. package/dist/git-cli/providers/commits.js.map +1 -1
  106. package/dist/git-cli/providers/config.d.ts +11 -2
  107. package/dist/git-cli/providers/config.d.ts.map +1 -1
  108. package/dist/git-cli/providers/config.js +27 -2
  109. package/dist/git-cli/providers/config.js.map +1 -1
  110. package/dist/git-cli/providers/diff.d.ts.map +1 -1
  111. package/dist/git-cli/providers/diff.js +4 -2
  112. package/dist/git-cli/providers/diff.js.map +1 -1
  113. package/dist/git-cli/providers/graph.d.ts.map +1 -1
  114. package/dist/git-cli/providers/graph.js +7 -2
  115. package/dist/git-cli/providers/graph.js.map +1 -1
  116. package/dist/git-cli/providers/operations.d.ts +13 -11
  117. package/dist/git-cli/providers/operations.d.ts.map +1 -1
  118. package/dist/git-cli/providers/operations.js +108 -38
  119. package/dist/git-cli/providers/operations.js.map +1 -1
  120. package/dist/git-cli/providers/patch.d.ts.map +1 -1
  121. package/dist/git-cli/providers/patch.js.map +1 -1
  122. package/dist/git-cli/providers/pausedOperations.d.ts +3 -1
  123. package/dist/git-cli/providers/pausedOperations.d.ts.map +1 -1
  124. package/dist/git-cli/providers/pausedOperations.js +7 -1
  125. package/dist/git-cli/providers/pausedOperations.js.map +1 -1
  126. package/dist/git-cli/providers/refs.d.ts +19 -2
  127. package/dist/git-cli/providers/refs.d.ts.map +1 -1
  128. package/dist/git-cli/providers/refs.js +286 -2
  129. package/dist/git-cli/providers/refs.js.map +1 -1
  130. package/dist/git-cli/providers/revision.js.map +1 -1
  131. package/dist/git-cli/providers/staging.d.ts +6 -0
  132. package/dist/git-cli/providers/staging.d.ts.map +1 -1
  133. package/dist/git-cli/providers/staging.js +32 -0
  134. package/dist/git-cli/providers/staging.js.map +1 -1
  135. package/dist/git-cli/providers/status.d.ts +4 -1
  136. package/dist/git-cli/providers/status.d.ts.map +1 -1
  137. package/dist/git-cli/providers/status.js +4 -3
  138. package/dist/git-cli/providers/status.js.map +1 -1
  139. package/dist/git-cli/providers/tags.d.ts.map +1 -1
  140. package/dist/git-cli/providers/tags.js +10 -6
  141. package/dist/git-cli/providers/tags.js.map +1 -1
  142. package/dist/ipc/discovery.d.ts +27 -0
  143. package/dist/ipc/discovery.d.ts.map +1 -0
  144. package/dist/ipc/discovery.js +38 -0
  145. package/dist/ipc/discovery.js.map +1 -0
  146. package/dist/ipc/ipcServer.d.ts +20 -0
  147. package/dist/ipc/ipcServer.d.ts.map +1 -0
  148. package/dist/ipc/ipcServer.js +162 -0
  149. package/dist/ipc/ipcServer.js.map +1 -0
  150. package/dist/plus/agents/providers/claudeCodeProvider.d.ts +114 -0
  151. package/dist/plus/agents/providers/claudeCodeProvider.d.ts.map +1 -0
  152. package/dist/plus/agents/providers/claudeCodeProvider.js +1480 -0
  153. package/dist/plus/agents/providers/claudeCodeProvider.js.map +1 -0
  154. package/dist/plus/agents/providers/claudeCodeTranscript.d.ts +36 -0
  155. package/dist/plus/agents/providers/claudeCodeTranscript.d.ts.map +1 -0
  156. package/dist/plus/agents/providers/claudeCodeTranscript.js +171 -0
  157. package/dist/plus/agents/providers/claudeCodeTranscript.js.map +1 -0
  158. package/dist/plus/agents/sanitizePrompt.d.ts +15 -0
  159. package/dist/plus/agents/sanitizePrompt.d.ts.map +1 -0
  160. package/dist/plus/agents/sanitizePrompt.js +103 -0
  161. package/dist/plus/agents/sanitizePrompt.js.map +1 -0
  162. package/dist/plus/agents/stateMachine.d.ts +32 -0
  163. package/dist/plus/agents/stateMachine.d.ts.map +1 -0
  164. package/dist/plus/agents/stateMachine.js +180 -0
  165. package/dist/plus/agents/stateMachine.js.map +1 -0
  166. package/dist/plus/agents/types.d.ts +203 -0
  167. package/dist/plus/agents/types.d.ts.map +1 -0
  168. package/dist/plus/agents/types.js +49 -0
  169. package/dist/plus/agents/types.js.map +1 -0
  170. package/dist/plus/ai/errors.d.ts +4 -1
  171. package/dist/plus/ai/errors.d.ts.map +1 -1
  172. package/dist/plus/ai/errors.js +38 -0
  173. package/dist/plus/ai/errors.js.map +1 -1
  174. package/dist/plus/ai/models/promptTemplates.d.ts +11 -2
  175. package/dist/plus/ai/models/promptTemplates.d.ts.map +1 -1
  176. package/dist/plus/ai/prompts.d.ts +1 -0
  177. package/dist/plus/ai/prompts.d.ts.map +1 -1
  178. package/dist/plus/ai/prompts.js +48 -8
  179. package/dist/plus/ai/prompts.js.map +1 -1
  180. package/dist/plus/ai/utils/results.utils.d.ts.map +1 -1
  181. package/dist/plus/ai/utils/results.utils.js.map +1 -1
  182. package/dist/plus/git-github/api/github.d.ts +10 -1
  183. package/dist/plus/git-github/api/github.d.ts.map +1 -1
  184. package/dist/plus/git-github/api/github.js +156 -49
  185. package/dist/plus/git-github/api/github.js.map +1 -1
  186. package/dist/plus/git-github/api/types.d.ts +8 -0
  187. package/dist/plus/git-github/api/types.d.ts.map +1 -1
  188. package/dist/plus/git-github/models.d.ts +1 -1
  189. package/dist/plus/git-github/models.d.ts.map +1 -1
  190. package/dist/plus/git-github/models.js.map +1 -1
  191. package/dist/plus/git-github/providers/github/blame.d.ts.map +1 -1
  192. package/dist/plus/git-github/providers/github/blame.js.map +1 -1
  193. package/dist/plus/git-github/providers/github/branches.d.ts +5 -1
  194. package/dist/plus/git-github/providers/github/branches.d.ts.map +1 -1
  195. package/dist/plus/git-github/providers/github/branches.js +47 -24
  196. package/dist/plus/git-github/providers/github/branches.js.map +1 -1
  197. package/dist/plus/git-github/providers/github/commits.d.ts.map +1 -1
  198. package/dist/plus/git-github/providers/github/commits.js +144 -92
  199. package/dist/plus/git-github/providers/github/commits.js.map +1 -1
  200. package/dist/plus/git-github/providers/github/diff.d.ts +1 -1
  201. package/dist/plus/git-github/providers/github/diff.d.ts.map +1 -1
  202. package/dist/plus/git-github/providers/github/diff.js +23 -9
  203. package/dist/plus/git-github/providers/github/diff.js.map +1 -1
  204. package/dist/plus/git-github/providers/github/refs.d.ts +9 -1
  205. package/dist/plus/git-github/providers/github/refs.d.ts.map +1 -1
  206. package/dist/plus/git-github/providers/github/refs.js +38 -13
  207. package/dist/plus/git-github/providers/github/refs.js.map +1 -1
  208. package/dist/plus/git-github/providers/github/revision.d.ts.map +1 -1
  209. package/dist/plus/git-github/providers/github/revision.js +1 -2
  210. package/dist/plus/git-github/providers/github/revision.js.map +1 -1
  211. package/dist/plus/git-github/providers/github/status.d.ts +4 -1
  212. package/dist/plus/git-github/providers/github/status.d.ts.map +1 -1
  213. package/dist/plus/git-github/providers/github/status.js +1 -1
  214. package/dist/plus/git-github/providers/github/status.js.map +1 -1
  215. package/dist/plus/git-github/providers/github/tags.d.ts.map +1 -1
  216. package/dist/plus/git-github/providers/github/tags.js +35 -36
  217. package/dist/plus/git-github/providers/github/tags.js.map +1 -1
  218. package/dist/plus/git-github/providers/githubGitProvider.d.ts.map +1 -1
  219. package/dist/plus/git-github/providers/githubGitProvider.js.map +1 -1
  220. package/dist/utils/color.d.ts.map +1 -1
  221. package/dist/utils/color.js.map +1 -1
  222. package/dist/utils/decorators/serializable.d.ts.map +1 -1
  223. package/dist/utils/decorators/serializable.js.map +1 -1
  224. package/dist/utils/dedupedAsyncCache.d.ts +37 -0
  225. package/dist/utils/dedupedAsyncCache.d.ts.map +1 -0
  226. package/dist/utils/dedupedAsyncCache.js +68 -0
  227. package/dist/utils/dedupedAsyncCache.js.map +1 -0
  228. package/dist/utils/diff.d.ts +2 -0
  229. package/dist/utils/diff.d.ts.map +1 -0
  230. package/dist/utils/diff.js +53 -0
  231. package/dist/utils/diff.js.map +1 -0
  232. package/dist/utils/disposable.d.ts.map +1 -1
  233. package/dist/utils/disposable.js.map +1 -1
  234. package/dist/utils/env/node/exec.d.ts.map +1 -1
  235. package/dist/utils/env/node/exec.js.map +1 -1
  236. package/dist/utils/error.d.ts.map +1 -1
  237. package/dist/utils/error.js.map +1 -1
  238. package/dist/utils/iterable.d.ts.map +1 -1
  239. package/dist/utils/iterable.js.map +1 -1
  240. package/dist/utils/logger.d.ts.map +1 -1
  241. package/dist/utils/logger.js.map +1 -1
  242. package/dist/utils/lruMap.d.ts +9 -0
  243. package/dist/utils/lruMap.d.ts.map +1 -1
  244. package/dist/utils/lruMap.js +26 -4
  245. package/dist/utils/lruMap.js.map +1 -1
  246. package/dist/utils/markdown.d.ts.map +1 -1
  247. package/dist/utils/markdown.js.map +1 -1
  248. package/dist/utils/mru.d.ts.map +1 -1
  249. package/dist/utils/mru.js.map +1 -1
  250. package/dist/utils/path.d.ts.map +1 -1
  251. package/dist/utils/path.js.map +1 -1
  252. package/dist/utils/promise.d.ts +1 -0
  253. package/dist/utils/promise.d.ts.map +1 -1
  254. package/dist/utils/promise.js +17 -0
  255. package/dist/utils/promise.js.map +1 -1
  256. package/dist/utils/promiseCache.d.ts +10 -0
  257. package/dist/utils/promiseCache.d.ts.map +1 -1
  258. package/dist/utils/promiseCache.js +22 -0
  259. package/dist/utils/promiseCache.js.map +1 -1
  260. package/dist/utils/string.d.ts.map +1 -1
  261. package/dist/utils/string.js.map +1 -1
  262. package/dist/utils/uri.d.ts.map +1 -1
  263. package/dist/utils/uri.js.map +1 -1
  264. package/dist/utils/version.d.ts.map +1 -1
  265. package/dist/utils/version.js.map +1 -1
  266. package/package.json +13 -1
  267. package/src/git/cache.ts +142 -28
  268. package/src/git/models/commit.ts +1 -0
  269. package/src/git/models/reference.ts +33 -0
  270. package/src/git/models/remote.ts +1 -0
  271. package/src/git/models/repository.ts +21 -3
  272. package/src/git/models/search.ts +2 -2
  273. package/src/git/models/worktree.ts +10 -2
  274. package/src/git/parsers/diffParser.ts +2 -0
  275. package/src/git/providers/branches.ts +22 -4
  276. package/src/git/providers/config.ts +2 -0
  277. package/src/git/providers/operations.ts +44 -0
  278. package/src/git/providers/pausedOperations.ts +1 -0
  279. package/src/git/providers/refs.ts +32 -3
  280. package/src/git/providers/staging.ts +12 -0
  281. package/src/git/providers/status.ts +6 -1
  282. package/src/git/remotes/azure-devops.ts +2 -0
  283. package/src/git/{exec.types.ts → run.types.ts} +22 -2
  284. package/src/git/service.ts +1 -0
  285. package/src/git/utils/autolink.utils.ts +1 -0
  286. package/src/git/utils/blame.utils.ts +2 -0
  287. package/src/git/utils/conflictResolution.utils.ts +31 -0
  288. package/src/git/utils/fileStatus.utils.ts +7 -1
  289. package/src/git/utils/search.utils.ts +2 -0
  290. package/src/git/utils/sorting.ts +17 -0
  291. package/src/git/utils/status.utils.ts +1 -0
  292. package/src/git/watching/classifyChange.ts +9 -0
  293. package/src/git/watching/gitIgnoreFilter.ts +2 -2
  294. package/src/git/watching/initWatcher.ts +2 -0
  295. package/src/git/watching/watchGroup.ts +3 -0
  296. package/src/git/watching/watchService.ts +38 -5
  297. package/src/git/watching/watchSession.ts +10 -0
  298. package/src/git-cli/exec/exec.types.ts +2 -2
  299. package/src/git-cli/exec/git.ts +6 -5
  300. package/src/git-cli/exec/gitQueue.ts +41 -12
  301. package/src/git-cli/parsers/blameParser.ts +1 -0
  302. package/src/git-cli/parsers/logParser.ts +1 -0
  303. package/src/git-cli/parsers/refParser.ts +33 -34
  304. package/src/git-cli/providers/blame.ts +1 -0
  305. package/src/git-cli/providers/branches.ts +164 -93
  306. package/src/git-cli/providers/commits.ts +83 -37
  307. package/src/git-cli/providers/config.ts +41 -2
  308. package/src/git-cli/providers/diff.ts +8 -2
  309. package/src/git-cli/providers/graph.ts +11 -2
  310. package/src/git-cli/providers/operations.ts +186 -49
  311. package/src/git-cli/providers/patch.ts +1 -0
  312. package/src/git-cli/providers/pausedOperations.ts +8 -0
  313. package/src/git-cli/providers/refs.ts +247 -3
  314. package/src/git-cli/providers/revision.ts +2 -2
  315. package/src/git-cli/providers/staging.ts +33 -0
  316. package/src/git-cli/providers/status.ts +15 -4
  317. package/src/git-cli/providers/tags.ts +15 -16
  318. package/src/ipc/discovery.ts +56 -0
  319. package/src/ipc/ipcServer.ts +171 -0
  320. package/src/plus/agents/providers/claudeCodeProvider.ts +1782 -0
  321. package/src/plus/agents/providers/claudeCodeTranscript.ts +214 -0
  322. package/src/plus/agents/sanitizePrompt.ts +109 -0
  323. package/src/plus/agents/stateMachine.ts +197 -0
  324. package/src/plus/agents/types.ts +277 -0
  325. package/src/plus/ai/errors.ts +40 -0
  326. package/src/plus/ai/models/promptTemplates.ts +13 -0
  327. package/src/plus/ai/prompts.ts +49 -8
  328. package/src/plus/ai/utils/results.utils.ts +2 -0
  329. package/src/plus/git-github/api/github.ts +199 -53
  330. package/src/plus/git-github/api/types.ts +15 -0
  331. package/src/plus/git-github/models.ts +1 -1
  332. package/src/plus/git-github/providers/github/blame.ts +2 -0
  333. package/src/plus/git-github/providers/github/branches.ts +61 -31
  334. package/src/plus/git-github/providers/github/commits.ts +231 -160
  335. package/src/plus/git-github/providers/github/diff.ts +27 -19
  336. package/src/plus/git-github/providers/github/refs.ts +57 -22
  337. package/src/plus/git-github/providers/github/revision.ts +1 -2
  338. package/src/plus/git-github/providers/github/status.ts +6 -1
  339. package/src/plus/git-github/providers/github/tags.ts +61 -62
  340. package/src/plus/git-github/providers/githubGitProvider.ts +1 -0
  341. package/src/utils/color.ts +2 -0
  342. package/src/utils/decorators/serializable.ts +1 -0
  343. package/src/utils/dedupedAsyncCache.ts +74 -0
  344. package/src/utils/diff.ts +61 -0
  345. package/src/utils/disposable.ts +2 -0
  346. package/src/utils/env/node/exec.ts +2 -0
  347. package/src/utils/error.ts +1 -0
  348. package/src/utils/iterable.ts +3 -0
  349. package/src/utils/logger.ts +1 -0
  350. package/src/utils/lruMap.ts +29 -4
  351. package/src/utils/markdown.ts +1 -0
  352. package/src/utils/mru.ts +2 -0
  353. package/src/utils/path.ts +1 -0
  354. package/src/utils/promise.ts +22 -0
  355. package/src/utils/promiseCache.ts +24 -0
  356. package/src/utils/string.ts +2 -0
  357. package/src/utils/uri.ts +1 -0
  358. package/src/utils/version.ts +1 -0
  359. package/dist/git/exec.types.d.ts.map +0 -1
  360. package/dist/git/exec.types.js +0 -2
  361. package/dist/git/exec.types.js.map +0 -1
@@ -96,8 +96,8 @@ export interface ParsedSearchQuery {
96
96
  export interface SearchQueryFilters {
97
97
  /** Specifies whether the search results will be filtered to specific files */
98
98
  files: boolean;
99
- /** Specifies whether the search results will be filtered to a specific type, only `stash` and `tip` are supported */
100
- type?: 'stash' | 'tip';
99
+ /** Specifies whether the search results will be filtered to a specific type, only `stash`, `tip`, and `wip` are supported */
100
+ type?: 'stash' | 'tip' | 'wip';
101
101
  /** Specifies whether the search results will be filtered to a specific ref or ref range */
102
102
  refs: boolean;
103
103
  }
@@ -6,6 +6,7 @@ import { basename, normalizePath, relative } from '../../utils/path.js';
6
6
  import type { Shape } from '../../utils/types.js';
7
7
  import type { Uri } from '../../utils/uri.js';
8
8
  import { getRepositoryService } from '../repositoryService.js';
9
+ import type { GitCommandPriority } from '../run.types.js';
9
10
  import { getRepositoryOrWorktreePath } from '../utils/repository.utils.js';
10
11
  import { shortenRevision } from '../utils/revision.utils.js';
11
12
  import type { GitBranch } from './branch.js';
@@ -73,6 +74,7 @@ export class GitWorktree {
73
74
  const relativePath = normalizePath(relative(this.workspaceFolder.uri.fsPath, this.uri.fsPath));
74
75
  return relativePath || this.workspaceFolder.name;
75
76
  }
77
+
76
78
  const relativePath = normalizePath(relative(this.repoPath, this.uri.fsPath));
77
79
  return relativePath || normalizePath(this.uri.fsPath);
78
80
  }
@@ -135,10 +137,15 @@ export class GitWorktree {
135
137
  : GitWorktree.formatDateFromNow(worktree);
136
138
  }
137
139
 
138
- static async getStatus(worktree: GitWorktree, cancellation?: AbortSignal): Promise<GitStatus | undefined> {
140
+ static async getStatus(
141
+ worktree: GitWorktree,
142
+ options?: { priority?: GitCommandPriority },
143
+ cancellation?: AbortSignal,
144
+ ): Promise<GitStatus | undefined> {
139
145
  if (worktree.type === 'bare') return undefined;
146
+
140
147
  const repo = getRepositoryService(worktree.path);
141
- return repo?.status.getStatus(cancellation);
148
+ return repo?.status.getStatus(options, cancellation);
142
149
  }
143
150
 
144
151
  static async hasWorkingChanges(
@@ -146,6 +153,7 @@ export class GitWorktree {
146
153
  options?: { staged?: boolean; unstaged?: boolean; untracked?: boolean },
147
154
  ): Promise<boolean | undefined> {
148
155
  if (worktree.type === 'bare') return undefined;
156
+
149
157
  const repo = getRepositoryService(worktree.path);
150
158
  return repo?.status.hasWorkingChanges(options);
151
159
  }
@@ -413,6 +413,7 @@ export function parseGitDiffNumStatFiles(data: string, repoPath: string): GitFil
413
413
  i++;
414
414
  continue;
415
415
  }
416
+
416
417
  const tabIndex2 = field.indexOf('\t', tabIndex1 + 1);
417
418
  if (tabIndex2 === -1) {
418
419
  i++;
@@ -427,6 +428,7 @@ export function parseGitDiffNumStatFiles(data: string, repoPath: string): GitFil
427
428
  if (path === '') {
428
429
  // Rename or copy: next two fields are oldPath and newPath (summary pass distinguishes R vs C)
429
430
  if (i + 2 >= fields.length) break;
431
+
430
432
  originalPath = fields[++i];
431
433
  path = fields[++i];
432
434
  }
@@ -1,10 +1,12 @@
1
1
  import type { PagedResult, PagingOptions } from '../../utils/paging.js';
2
+ import type { GkConfigInvalidationTarget } from '../cache.js';
2
3
  import type { BranchDisposition, GitBranch } from '../models/branch.js';
3
4
  import type { GitCommitStats } from '../models/commit.js';
4
5
  import type { GitContributor } from '../models/contributor.js';
5
6
  import type { ConflictDetectionResult } from '../models/mergeConflicts.js';
6
7
  import type { PullRequest } from '../models/pullRequest.js';
7
8
  import type { GitBranchReference } from '../models/reference.js';
9
+ import type { GitCommandPriority } from '../run.types.js';
8
10
  import type { BranchSortOptions } from '../utils/sorting.js';
9
11
 
10
12
  export interface BranchContributionsOverview extends GitCommitStats<number> {
@@ -43,7 +45,7 @@ export interface GitBranchesSubProvider {
43
45
  getBranchContributionsOverview(
44
46
  repoPath: string,
45
47
  ref: string,
46
- options?: { associatedPullRequest?: Promise<PullRequest | undefined> },
48
+ options?: { associatedPullRequest?: Promise<PullRequest | undefined>; priority?: GitCommandPriority },
47
49
  cancellation?: AbortSignal,
48
50
  ): Promise<BranchContributionsOverview | undefined>;
49
51
  getBranchesWithCommits(
@@ -58,6 +60,7 @@ export interface GitBranchesSubProvider {
58
60
  getDefaultBranchName(
59
61
  repoPath: string | undefined,
60
62
  remote?: string,
63
+ options?: { priority?: GitCommandPriority },
61
64
  cancellation?: AbortSignal,
62
65
  ): Promise<string | undefined>;
63
66
 
@@ -94,7 +97,12 @@ export interface GitBranchesSubProvider {
94
97
  targetBranch: string,
95
98
  cancellation?: AbortSignal,
96
99
  ): Promise<ConflictDetectionResult>;
97
- getBaseBranchName?(repoPath: string, ref: string, cancellation?: AbortSignal): Promise<string | undefined>;
100
+ getBaseBranchName?(
101
+ repoPath: string,
102
+ ref: string,
103
+ options?: { priority?: GitCommandPriority },
104
+ cancellation?: AbortSignal,
105
+ ): Promise<string | undefined>;
98
106
  getStoredMergeTargetBranchName?(repoPath: string, ref: string): Promise<string | undefined>;
99
107
  getStoredDetectedMergeTargetBranchName?(repoPath: string, ref: string): Promise<string | undefined>;
100
108
  getStoredUserMergeTargetBranchName?(repoPath: string, ref: string): Promise<string | undefined>;
@@ -108,7 +116,17 @@ export interface GitBranchesSubProvider {
108
116
  branchName: string,
109
117
  disposition: BranchDisposition | undefined,
110
118
  ): Promise<void>;
111
- storeBaseBranchName?(repoPath: string, ref: string, base: string): Promise<void>;
112
- storeMergeTargetBranchName?(repoPath: string, ref: string, target: string): Promise<void>;
119
+ storeBaseBranchName?(
120
+ repoPath: string,
121
+ ref: string,
122
+ base: string,
123
+ options?: { skipInvalidation?: readonly GkConfigInvalidationTarget[] },
124
+ ): Promise<void>;
125
+ storeMergeTargetBranchName?(
126
+ repoPath: string,
127
+ ref: string,
128
+ target: string,
129
+ options?: { skipInvalidation?: readonly GkConfigInvalidationTarget[] },
130
+ ): Promise<void>;
113
131
  storeUserMergeTargetBranchName?(repoPath: string, ref: string, target: string | undefined): Promise<void>;
114
132
  }
@@ -1,3 +1,4 @@
1
+ import type { GkConfigInvalidationTarget } from '../cache.js';
1
2
  import type { GitDir } from '../models/repository.js';
2
3
  import type { SigningConfig, ValidationResult } from '../models/signature.js';
3
4
  import type { GitUser } from '../models/user.js';
@@ -97,6 +98,7 @@ export interface GitConfigSubProvider {
97
98
  repoPath: string,
98
99
  key: GkConfigKeys | DeprecatedGkConfigKeys,
99
100
  value: string | undefined,
101
+ options?: { skipInvalidation?: readonly GkConfigInvalidationTarget[] },
100
102
  ): Promise<void>;
101
103
 
102
104
  getSigningConfig?(repoPath: string): Promise<SigningConfig>;
@@ -1,5 +1,6 @@
1
1
  import type { GitBranchReference, GitReference } from '../models/reference.js';
2
2
  import type { GitConflictFile } from '../models/staging.js';
3
+ import type { GitRunOptions } from '../run.types.js';
3
4
 
4
5
  export interface GitOperationResult {
5
6
  readonly conflicted: boolean;
@@ -7,16 +8,51 @@ export interface GitOperationResult {
7
8
  readonly conflicts?: GitConflictFile[];
8
9
  }
9
10
 
11
+ /**
12
+ * Spawn-layer overrides callers can pass to user-initiated git operations to inject per-call
13
+ * environment variables, an `AbortSignal` for cancellation, or a custom `timeout`. Forwarded
14
+ * verbatim to the underlying `git.run(...)` invocation; cannot override op-owned fields like
15
+ * `cwd`, `configs`, `errors`, or `stdin`.
16
+ *
17
+ * Note: passing `timeout` overrides per-op safety defaults. `merge`, `rebase`, and `revert`
18
+ * intentionally disable the timeout (set it to 0) because those operations can take a long
19
+ * time; a caller-supplied `timeout` will replace that "no timeout" setting, so use with care.
20
+ */
21
+ export type GitOperationRunOptions = Pick<GitRunOptions, 'env' | 'cancellation' | 'timeout'>;
22
+
10
23
  export interface GitOperationsSubProvider {
11
24
  checkout(
12
25
  repoPath: string,
13
26
  ref: string,
14
27
  options?: { createBranch?: string | undefined } | { path?: string | undefined },
28
+ runOptions?: GitOperationRunOptions,
29
+ ): Promise<void>;
30
+ /**
31
+ * Checks out one side of a conflicted path during a paused merge/rebase/cherry-pick.
32
+ * Executes `git checkout --ours|--theirs -- <path>`, leaving the file unstaged.
33
+ */
34
+ checkoutConflictedPath(
35
+ repoPath: string,
36
+ path: string,
37
+ side: 'ours' | 'theirs',
38
+ runOptions?: GitOperationRunOptions,
39
+ ): Promise<void>;
40
+ /**
41
+ * Checks out one side for multiple conflicted paths during a paused merge/rebase/cherry-pick.
42
+ * Batches paths into `git checkout --ours|--theirs -- <paths...>`, chunked to stay under the
43
+ * CLI length limit. Leaves files unstaged.
44
+ */
45
+ checkoutConflictedPaths(
46
+ repoPath: string,
47
+ paths: string[],
48
+ side: 'ours' | 'theirs',
49
+ runOptions?: GitOperationRunOptions,
15
50
  ): Promise<void>;
16
51
  cherryPick(
17
52
  repoPath: string,
18
53
  revs: string[],
19
54
  options?: { edit?: boolean; noCommit?: boolean; source?: unknown },
55
+ runOptions?: GitOperationRunOptions,
20
56
  ): Promise<GitOperationResult>;
21
57
  commit(
22
58
  repoPath: string,
@@ -30,6 +66,7 @@ export interface GitOperationsSubProvider {
30
66
  signoff?: boolean;
31
67
  source?: unknown;
32
68
  },
69
+ runOptions?: GitOperationRunOptions,
33
70
  ): Promise<void>;
34
71
  fetch(
35
72
  repoPath: string,
@@ -40,11 +77,13 @@ export interface GitOperationsSubProvider {
40
77
  pull?: boolean | undefined;
41
78
  remote?: string | undefined;
42
79
  },
80
+ runOptions?: GitOperationRunOptions,
43
81
  ): Promise<void>;
44
82
  merge(
45
83
  repoPath: string,
46
84
  ref: string,
47
85
  options?: { fastForward?: boolean | 'only'; noCommit?: boolean; squash?: boolean; source?: unknown },
86
+ runOptions?: GitOperationRunOptions,
48
87
  ): Promise<GitOperationResult>;
49
88
  pull(
50
89
  repoPath: string,
@@ -54,6 +93,7 @@ export interface GitOperationsSubProvider {
54
93
  tags?: boolean | undefined;
55
94
  source?: unknown;
56
95
  },
96
+ runOptions?: GitOperationRunOptions,
57
97
  ): Promise<void>;
58
98
  push(
59
99
  repoPath: string,
@@ -62,6 +102,7 @@ export interface GitOperationsSubProvider {
62
102
  force?: boolean | undefined;
63
103
  publish?: { remote: string };
64
104
  },
105
+ runOptions?: GitOperationRunOptions,
65
106
  ): Promise<void>;
66
107
  rebase(
67
108
  repoPath: string,
@@ -75,15 +116,18 @@ export interface GitOperationsSubProvider {
75
116
  updateRefs?: boolean;
76
117
  source?: unknown;
77
118
  },
119
+ runOptions?: GitOperationRunOptions,
78
120
  ): Promise<GitOperationResult>;
79
121
  reset(
80
122
  repoPath: string,
81
123
  rev: string,
82
124
  options?: { mode?: 'hard' | 'keep' | 'merge' | 'mixed' | 'soft' },
125
+ runOptions?: GitOperationRunOptions,
83
126
  ): Promise<void>;
84
127
  revert(
85
128
  repoPath: string,
86
129
  refs: string[],
87
130
  options?: { editMessage?: boolean; source?: unknown },
131
+ runOptions?: GitOperationRunOptions,
88
132
  ): Promise<GitOperationResult>;
89
133
  }
@@ -3,6 +3,7 @@ import type { GitPausedOperationStatus } from '../models/pausedOperationStatus.j
3
3
  export interface GitPausedOperationsSubProvider {
4
4
  getPausedOperationStatus(
5
5
  repoPath: string,
6
+ options?: { force?: boolean },
6
7
  cancellation?: AbortSignal,
7
8
  ): Promise<GitPausedOperationStatus | undefined>;
8
9
  abortPausedOperation(repoPath: string, options?: { quit?: boolean }): Promise<void>;
@@ -1,7 +1,8 @@
1
1
  import type { Uri } from '../../utils/uri.js';
2
2
  import type { GitBranch } from '../models/branch.js';
3
- import type { GitReference } from '../models/reference.js';
3
+ import type { GitReference, GitRefTip } from '../models/reference.js';
4
4
  import type { GitTag } from '../models/tag.js';
5
+ import type { GitCommandPriority } from '../run.types.js';
5
6
 
6
7
  export interface GitRefsSubProvider {
7
8
  checkIfCouldBeValidBranchOrTagName(repoPath: string, ref: string): Promise<boolean>;
@@ -9,11 +10,39 @@ export interface GitRefsSubProvider {
9
10
  repoPath: string,
10
11
  ref1: string,
11
12
  ref2: string,
12
- options?: { forkPoint?: boolean | undefined },
13
+ options?: { forkPoint?: boolean | undefined; priority?: GitCommandPriority },
13
14
  cancellation?: AbortSignal,
14
15
  ): Promise<string | undefined>;
15
16
  getReference(repoPath: string, ref: string, cancellation?: AbortSignal): Promise<GitReference | undefined>;
16
- getSymbolicReferenceName?(repoPath: string, ref: string, cancellation?: AbortSignal): Promise<string | undefined>;
17
+ /**
18
+ * Lightweight enumeration of ref tips (heads/remotes/tags) — no enrichment.
19
+ * Use this when you need a SHA-to-refs map; use `getBranches`/`getTags` for full models.
20
+ */
21
+ getRefTips(
22
+ repoPath: string,
23
+ options?: { include?: ReadonlyArray<'heads' | 'remotes' | 'tags'> },
24
+ cancellation?: AbortSignal,
25
+ ): Promise<GitRefTip[]>;
26
+ /**
27
+ * Batch reachability — for each input SHA, the refs whose tips contain it.
28
+ *
29
+ * One bounded `git rev-list --topo-order --parents --all ^<oldestSha>^@` walk; ref-set
30
+ * propagation runs in memory. Cost is O(walked subgraph), not O(N × refs) like the per-sha
31
+ * `getBranchesWithCommits([sha])` pattern. Pass the oldest SHA in your dataset to bound the walk.
32
+ */
33
+ getRefsContainingShas(
34
+ repoPath: string,
35
+ shas: ReadonlySet<string> | readonly string[],
36
+ oldestSha: string,
37
+ options?: { include?: ReadonlyArray<'heads' | 'remotes' | 'tags'> },
38
+ cancellation?: AbortSignal,
39
+ ): Promise<Map<string, GitRefTip[]>>;
40
+ getSymbolicReferenceName?(
41
+ repoPath: string,
42
+ ref: string,
43
+ options?: { priority?: GitCommandPriority },
44
+ cancellation?: AbortSignal,
45
+ ): Promise<string | undefined>;
17
46
  hasBranchOrTag(
18
47
  repoPath: string | undefined,
19
48
  options?: {
@@ -19,6 +19,18 @@ export interface GitStagingSubProvider {
19
19
  unstageFile(repoPath: string, pathOrUri: string | Uri): Promise<void>;
20
20
  unstageFiles(repoPath: string, pathsOrUris: (string | Uri)[]): Promise<void>;
21
21
  unstageDirectory(repoPath: string, directoryOrUri: string | Uri): Promise<void>;
22
+ /**
23
+ * Removes a file from both the working tree and the index in a single operation
24
+ * (`git rm [-f] -- <path>`). Use during conflict resolution when the user has chosen a
25
+ * side that is itself a deletion — atomic, so it can't leave a working-tree-modified
26
+ * file accidentally staged with content. Pass `force: true` to discard local
27
+ * modifications (required for conflicted files).
28
+ */
29
+ removeFile(repoPath: string, pathOrUri: string | Uri, options?: { force?: boolean }): Promise<void>;
30
+ /**
31
+ * Batched form of {@link removeFile}. Chunks paths to stay under the CLI length limit.
32
+ */
33
+ removeFiles(repoPath: string, pathsOrUris: (string | Uri)[], options?: { force?: boolean }): Promise<void>;
22
34
  stageAll(repoPath: string): Promise<void>;
23
35
  unstageAll(repoPath: string): Promise<void>;
24
36
  }
@@ -3,6 +3,7 @@ import type { GitFile } from '../models/file.js';
3
3
  import type { GitConflictFile } from '../models/staging.js';
4
4
  import type { GitStatus } from '../models/status.js';
5
5
  import type { GitStatusFile } from '../models/statusFile.js';
6
+ import type { GitCommandPriority } from '../run.types.js';
6
7
 
7
8
  export interface GitWorkingChangesState {
8
9
  staged: boolean;
@@ -11,7 +12,11 @@ export interface GitWorkingChangesState {
11
12
  }
12
13
 
13
14
  export interface GitStatusSubProvider {
14
- getStatus(repoPath: string | undefined, cancellation?: AbortSignal): Promise<GitStatus | undefined>;
15
+ getStatus(
16
+ repoPath: string | undefined,
17
+ options?: { priority?: GitCommandPriority },
18
+ cancellation?: AbortSignal,
19
+ ): Promise<GitStatus | undefined>;
15
20
  getStatusForFile?(
16
21
  repoPath: string,
17
22
  pathOrUri: string | Uri,
@@ -34,6 +34,7 @@ function parseVstsHttpsUrl(url: URL): [string, string, string] {
34
34
  const owner = getVSTSOwner(url);
35
35
  const match = azureProjectRepoRegex.exec(url.pathname);
36
36
  if (match == null) throw new Error(`Invalid VSTS URL: ${url.toString()}`);
37
+
37
38
  const [, project, repo] = match;
38
39
  return [owner, project, repo];
39
40
  }
@@ -43,6 +44,7 @@ const azureHttpsUrlRegex2 = /([^/]+)\/([^/]+)\/_git\/([^/]+)/;
43
44
  function parseAzureNewStyleUrl(url: URL): [string, string, string] {
44
45
  const match = azureHttpsUrlRegex2.exec(url.pathname);
45
46
  if (match == null) throw new Error(`Invalid Azure URL: ${url.toString()}`);
47
+
46
48
  const [, owner, project, repo] = match;
47
49
  return [owner, project, repo];
48
50
  }
@@ -27,11 +27,11 @@ export interface GitResultCache {
27
27
  * Priority levels for git commands.
28
28
  * - `interactive`: User-initiated operations (blame, hover) - highest priority
29
29
  * - `normal`: Standard operations (status, config) - default priority
30
- * - `background`: Expensive operations (log, graph) - can be throttled
30
+ * - `background`: Expensive operations (graph rendering, full history walks) - can be throttled
31
31
  */
32
32
  export type GitCommandPriority = 'interactive' | 'normal' | 'background';
33
33
 
34
- export interface GitExecOptions {
34
+ export interface GitRunOptions {
35
35
  cancellation?: AbortSignal;
36
36
  configs?: readonly string[];
37
37
  readonly correlationKey?: string;
@@ -63,6 +63,26 @@ export interface GitExecOptions {
63
63
  readonly timeout?: number;
64
64
  }
65
65
 
66
+ /**
67
+ * Untyped escape hatch for raw `git <args>` invocation, returned by
68
+ * `GlGitProvider.createUnsafeGit`.
69
+ *
70
+ * "Unsafe" here means **bypasses the typed safety net** the rest of GitLens relies on
71
+ * — sub-provider cancellation/caching/decorator behaviors and signing-awareness do
72
+ * not apply when commands are issued through this object. It does NOT imply command
73
+ * injection risk; the caller still controls the args.
74
+ *
75
+ * Hand instances to libraries that need to issue arbitrary git commands
76
+ * (`@gitkraken/compose-tools`, `@gitkraken/shared-tools` undo). Inside GitLens
77
+ * itself, prefer the typed sub-providers on `RepositoryService` (`branches`,
78
+ * `commits`, `diff`, `staging`, `stash`, `status`, …). Holding an `UnsafeGit`
79
+ * just to call `run(...)` for an ad-hoc command is almost always wrong — the
80
+ * abstraction exists so it can be handed off, not used directly.
81
+ */
82
+ export interface UnsafeGit {
83
+ run(args: readonly string[], options?: GitRunOptions): Promise<GitResult>;
84
+ }
85
+
66
86
  export interface GitSpawnOptions {
67
87
  cancellation?: AbortSignal;
68
88
  configs?: readonly string[];
@@ -77,6 +77,7 @@ export class GitService implements UnifiedDisposable {
77
77
  if (GitService._instance != null) {
78
78
  throw new Error('GitService already exists — only one instance is allowed');
79
79
  }
80
+
80
81
  const instance = new GitService(watchingProvider);
81
82
  GitService._instance = instance;
82
83
  return instance;
@@ -179,6 +179,7 @@ export function getBranchAutolinks(
179
179
  for (const regex of ref.branchNameRegexes) {
180
180
  match = branchName.match(regex);
181
181
  if (!match?.groups) continue;
182
+
182
183
  num = match.groups.issueKeyNumber;
183
184
  const linkUrl = ref.url?.replace(numRegex, num);
184
185
  autolinks.set(linkUrl, {
@@ -249,6 +249,7 @@ export function buildDirtyBlame(cleanBlame: GitBlame, mapping: LineMappingResult
249
249
  const lineCountsBySha = new Map<string, number>();
250
250
  for (const blameLine of dirtyBlameLines) {
251
251
  if (blameLine == null) continue;
252
+
252
253
  lineCountsBySha.set(blameLine.sha, (lineCountsBySha.get(blameLine.sha) ?? 0) + 1);
253
254
  }
254
255
 
@@ -276,6 +277,7 @@ export function buildDirtyBlame(cleanBlame: GitBlame, mapping: LineMappingResult
276
277
  for (const [, c] of commits) {
277
278
  if (!c.author.name) continue;
278
279
  if (authors.has(c.author.name)) continue;
280
+
279
281
  authors.set(c.author.name, { name: c.author.name, lineCount: 0, current: c.author.current });
280
282
  }
281
283
 
@@ -0,0 +1,31 @@
1
+ import type { GitFileConflictStatus } from '../models/fileStatus.js';
2
+
3
+ export type ConflictResolutionAction = 'take-ours' | 'take-theirs' | 'delete' | 'unsupported';
4
+
5
+ export function classifyConflictAction(
6
+ status: GitFileConflictStatus,
7
+ resolution: 'current' | 'incoming',
8
+ ): ConflictResolutionAction {
9
+ const takeCurrent = resolution === 'current';
10
+
11
+ if (status === 'DD') return 'delete';
12
+ if (status === 'UD' && !takeCurrent) return 'delete';
13
+ if (status === 'DU' && takeCurrent) return 'delete';
14
+
15
+ // `git checkout --{ours,theirs}` fails when the requested stage is absent.
16
+ // Single-file UI filters these out; bulk resolve surfaces them as failures.
17
+ if (status === 'UA' && takeCurrent) return 'unsupported';
18
+ if (status === 'AU' && !takeCurrent) return 'unsupported';
19
+
20
+ return takeCurrent ? 'take-ours' : 'take-theirs';
21
+ }
22
+
23
+ // Stage Current is invalid when the current side has no content to take (added/deleted only by them, or both deleted)
24
+ export function canStageCurrent(status: GitFileConflictStatus): boolean {
25
+ return status !== 'UA' && status !== 'DD';
26
+ }
27
+
28
+ // Stage Incoming is invalid when the incoming side has no content to take (added/deleted only by us, or both deleted)
29
+ export function canStageIncoming(status: GitFileConflictStatus): boolean {
30
+ return status !== 'AU' && status !== 'DD';
31
+ }
@@ -1,4 +1,4 @@
1
- import type { GitFileStatus } from '../models/fileStatus.js';
1
+ import type { GitFileConflictStatus, GitFileStatus } from '../models/fileStatus.js';
2
2
 
3
3
  const statusIconsMap = {
4
4
  '.': undefined,
@@ -47,3 +47,9 @@ const statusTextMap = {
47
47
  export function getGitFileStatusText(status: GitFileStatus | keyof typeof statusTextMap): string {
48
48
  return statusTextMap[status] ?? 'Unknown';
49
49
  }
50
+
51
+ const conflictStatuses = new Set<string>(['U', 'AA', 'AU', 'UA', 'DD', 'DU', 'UD', 'UU']);
52
+
53
+ export function isConflictStatus(status: string | undefined): status is 'U' | GitFileConflictStatus {
54
+ return status != null && conflictStatuses.has(status);
55
+ }
@@ -274,6 +274,8 @@ export function parseSearchQueryGitCommand(
274
274
  searchArgs.add('--no-walk');
275
275
  } else if (value === 'tip') {
276
276
  filters.type = 'tip';
277
+ } else if (value === 'wip') {
278
+ filters.type = 'wip';
277
279
  }
278
280
  }
279
281
 
@@ -46,6 +46,23 @@ export function compareReachableRefs(
46
46
  return 0;
47
47
  }
48
48
 
49
+ // Hoisted from `compareRefTips` so we don't re-allocate the lookup per sort iteration.
50
+ const refTipTypeOrder = { branch: 0, remote: 1, tag: 2 } as const;
51
+
52
+ /**
53
+ * Comparator for `GitRefTip` arrays — local branch < remote branch < tag, tags by version desc.
54
+ * Mirrors `compareReachableRefs` for the lighter ref-tip shape.
55
+ */
56
+ export function compareRefTips(a: { type: 'branch' | 'remote' | 'tag'; name: string }, b: typeof a): number {
57
+ if (a.type !== b.type) {
58
+ return refTipTypeOrder[a.type] - refTipTypeOrder[b.type];
59
+ }
60
+ if (a.type === 'tag') {
61
+ return compareByVersionDescending(a.name, b.name);
62
+ }
63
+ return 0;
64
+ }
65
+
49
66
  export function sortBranches(branches: GitBranch[], options?: BranchSortOptions): GitBranch[] {
50
67
  options = { current: true, groupByType: true, orderBy: 'date:desc', ...options };
51
68
 
@@ -69,6 +69,7 @@ export function getUpstreamStatus(
69
69
  },
70
70
  ): string {
71
71
  if (upstream == null) return options?.empty ?? '';
72
+
72
73
  const {
73
74
  state: { ahead, behind },
74
75
  } = upstream;
@@ -17,6 +17,15 @@ const classifyRegex =
17
17
  * handles it as a last-fetched timestamp).
18
18
  */
19
19
  export function classifyGitDirChange(relativePath: string): RepositoryChange[] | undefined {
20
+ // User-edited todo file (and its backup) — handled by VS Code's TextDocument
21
+ // events in the rebase webview (see `rebaseWebviewProvider.ts`). Suppress here
22
+ // to avoid thrashing the repo update path on every save during an interactive
23
+ // rebase; rebase lifecycle (start/stop/step) still fires from sibling files
24
+ // in `rebase-merge/` and the directory itself.
25
+ if (relativePath.endsWith('/git-rebase-todo') || relativePath.endsWith('/git-rebase-todo.backup')) {
26
+ return undefined;
27
+ }
28
+
20
29
  const match = classifyRegex.exec(relativePath);
21
30
  if (match == null) return undefined;
22
31
 
@@ -1,7 +1,7 @@
1
- import { getScopedCounter } from '../../utils/counter.js';
2
- import { fileUri } from '../../utils/uri.js';
3
1
  import type { Ignore } from 'ignore';
4
2
  import ignore from 'ignore';
3
+ import { getScopedCounter } from '../../utils/counter.js';
4
+ import { fileUri } from '../../utils/uri.js';
5
5
  import type { FileSystemProvider } from '../context.js';
6
6
 
7
7
  export interface GitIgnoreFilterOptions {
@@ -36,6 +36,7 @@ export class RepositoryInitWatcher implements UnifiedDisposable {
36
36
 
37
37
  dispose(): void {
38
38
  if (this._disposed) return;
39
+
39
40
  this._disposed = true;
40
41
 
41
42
  for (const watcher of this.watchers.values()) {
@@ -60,6 +61,7 @@ export class RepositoryInitWatcher implements UnifiedDisposable {
60
61
 
61
62
  const watcher = this.provider.createWatcher(basePath, gitInitGlob, event => {
62
63
  if (event.reason !== 'create') return;
64
+
63
65
  this.emitter.fire({ path: event.path, basePath: basePath });
64
66
  });
65
67
 
@@ -54,6 +54,7 @@ export class WatchGroup implements UnifiedDisposable {
54
54
  /** Dispose the entire group (common watcher + all root watchers). */
55
55
  dispose(): void {
56
56
  if (this._disposed) return;
57
+
57
58
  this._disposed = true;
58
59
 
59
60
  for (const entry of this._sessions.values()) {
@@ -132,6 +133,7 @@ export class WatchGroup implements UnifiedDisposable {
132
133
  private onCommonEvent(event: FileWatchEvent): void {
133
134
  // Compute relative path from common git dir
134
135
  if (!isDescendant(event.path, this.commonGitDir)) return;
136
+
135
137
  const relativePath = relative(this.commonGitDir, event.path);
136
138
  if (shouldIgnoreRepoPath(relativePath)) return;
137
139
 
@@ -161,6 +163,7 @@ export class WatchGroup implements UnifiedDisposable {
161
163
 
162
164
  private onRootEvent(event: FileWatchEvent, entry: SessionEntry): void {
163
165
  if (!isDescendant(event.path, entry.gitDirPath)) return;
166
+
164
167
  const relativePath = relative(entry.gitDirPath, event.path);
165
168
  if (shouldIgnoreRepoPath(relativePath)) return;
166
169