mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-01-22 05:29:44 +02:00
don't ignore error when commit with subprocess fails
If signing by GPG is enabled, the git commit command will be executed in a subprocess, differently from when it is executed without GPG signing. In case of an error, e.g. a failing pre-commit hook, the error needs to be passed along, and not just ignored.
This commit is contained in:
parent
beedc2553d
commit
f981255a5b
@ -634,7 +634,8 @@ func (gui *Gui) runSubprocess(cmdObj oscommands.ICmdObj) error {
|
||||
|
||||
fmt.Fprintf(os.Stdout, "\n%s\n\n", style.FgBlue.Sprint("+ "+strings.Join(subprocess.Args, " ")))
|
||||
|
||||
if err := subprocess.Run(); err != nil {
|
||||
err := subprocess.Run()
|
||||
if err != nil {
|
||||
// not handling the error explicitly because usually we're going to see it
|
||||
// in the output anyway
|
||||
gui.Log.Error(err)
|
||||
@ -647,7 +648,7 @@ func (gui *Gui) runSubprocess(cmdObj oscommands.ICmdObj) error {
|
||||
fmt.Fprintf(os.Stdout, "\n%s", style.FgGreen.Sprint(gui.Tr.PressEnterToReturn))
|
||||
fmt.Scanln() // wait for enter press
|
||||
|
||||
return nil
|
||||
return err
|
||||
}
|
||||
|
||||
func (gui *Gui) loadNewRepo() error {
|
||||
|
Loading…
x
Reference in New Issue
Block a user