Commit 709fe16
committed
fix(Branches): 修复无上游分支 Push 失败并暴露 git 真实错误;
hyperGit.push 原以零参数调用 repo.push(),当前分支无上游时 git push
(push.default=simple)必然失败,vscode.git 包装为 GitError,其 .message
为通用串「Failed to execute git」,真实 stderr 被吞没。
改为以 HEAD.upstream 是否存在为分支:有上游沿用 repo.push();无上游时
选定 remote(单 remote 直用、多 remote 弹选择)并以 repo.push(remote,
branch, true) 建立 -u 追踪。同时增强 errMsg 优先暴露 GitError.stderr,
使「无上游」「non-fast-forward」等失败可读(push/pull/fetch 等同享)。
🤖 Generated with [Claude Code](https://github.com/claude), [CodeX](https://openai.com), [Gemini](https://github.com/apps/gemini-code-assist)
Co-Authored-By: Aurelius Huang<threefish.ai@gmail.com>1 parent 219c185 commit 709fe16
1 file changed
Lines changed: 41 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
20 | 33 | | |
21 | 34 | | |
22 | 35 | | |
| |||
212 | 225 | | |
213 | 226 | | |
214 | 227 | | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
215 | 233 | | |
216 | | - | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
217 | 255 | | |
| 256 | + | |
218 | 257 | | |
219 | 258 | | |
220 | 259 | | |
| |||
0 commit comments