fix(cmd): 修复自动暂存失败时未中断执行的隐患

- 检查 `git.StageAll` 的返回值,若失败则打印错误并终止提交流程
This commit is contained in:
unclesam committed 2026-08-22 17:01:35 +08:00
1 parent c7e8b449c9
commit 10cbfc39a5
1 file changed
+4 -1
+4 -1
View File
@@ -103,7 +103,10 @@ var msgCmd = &cobra.Command{
if flagCommit { if flagCommit {
if flagAll { if flagAll {
_ = git.StageAll(ctx) if err := git.StageAll(ctx); err != nil {
ui.PrintError("自动暂存失败: %v", err)
return
}
} }
executeGitCommit(ctx, commitMsg) executeGitCommit(ctx, commitMsg)
return return