mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-05-13 05:15:53 +02:00
no panic on git commit error
This commit is contained in:
parent
0e0acc90e1
commit
b1918f2f68
2 changed files with 4 additions and 5 deletions
|
@ -160,8 +160,8 @@ func handleCommitPress(g *gocui.Gui, filesView *gocui.View) error {
|
||||||
if message == "" {
|
if message == "" {
|
||||||
return createErrorPanel(g, "You cannot commit without a commit message")
|
return createErrorPanel(g, "You cannot commit without a commit message")
|
||||||
}
|
}
|
||||||
if err := gitCommit(message); err != nil {
|
if output, err := gitCommit(message); err != nil {
|
||||||
panic(err)
|
return createErrorPanel(g, output)
|
||||||
}
|
}
|
||||||
refreshFiles(g)
|
refreshFiles(g)
|
||||||
return refreshCommits(g)
|
return refreshCommits(g)
|
||||||
|
|
|
@ -445,9 +445,8 @@ func removeFile(file GitFile) error {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
func gitCommit(message string) error {
|
func gitCommit(message string) (string, error) {
|
||||||
_, err := runDirectCommand("git commit -m \"" + message + "\"")
|
return runCommand("git commit -m \"" + message + "\"")
|
||||||
return err
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func gitPull() (string, error) {
|
func gitPull() (string, error) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue