fix(cmd): 修复自动暂存失败时未中断执行的隐患
- 检查 `git.StageAll` 的返回值,若失败则打印错误并终止提交流程
This commit is contained in:
1 parent
c7e8b449c9
commit
10cbfc39a5
1 file changed
+4
-1
+4
-1
@@ -103,7 +103,10 @@ var msgCmd = &cobra.Command{
|
||||
|
||||
if flagCommit {
|
||||
if flagAll {
|
||||
_ = git.StageAll(ctx)
|
||||
if err := git.StageAll(ctx); err != nil {
|
||||
ui.PrintError("自动暂存失败: %v", err)
|
||||
return
|
||||
}
|
||||
}
|
||||
executeGitCommit(ctx, commitMsg)
|
||||
return
|
||||
|
||||
Reference in new issue
Block a user