1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-05-29 23:17:32 +02:00

"step one towards dealing with gpgsign"

This commit is contained in:
Jesse Duffield 2018-08-08 08:24:24 +10:00
parent 2f50cbf2b8
commit 92e75d4602
2 changed files with 7 additions and 2 deletions

View File

@ -176,7 +176,7 @@ func handleCommitPress(g *gocui.Gui, filesView *gocui.View) error {
if message == "" {
return createErrorPanel(g, "You cannot commit without a commit message")
}
if output, err := gitCommit(message); err != nil {
if output, err := gitCommit(g, message); err != nil {
return createErrorPanel(g, output)
}
refreshFiles(g)

View File

@ -447,7 +447,12 @@ func removeFile(file GitFile) error {
return err
}
func gitCommit(message string) (string, error) {
func gitCommit(g *gocui.Gui, message string) (string, error) {
out, _ := runDirectCommand("git config --get commit.gpgsign")
if out != "" {
runSubProcess(g, "git", "commit", "-m", "\""+message+"\"")
return "", nil
}
return runDirectCommand("git commit -m \"" + message + "\"")
}