From 4cd2d7065993a8dfbb0f933177b128990f699e28 Mon Sep 17 00:00:00 2001 From: Jesse Duffield Date: Sun, 12 Aug 2018 23:14:37 +1000 Subject: [PATCH] revert to using cli git command rather than go-git for committing --- gitcommands.go | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/gitcommands.go b/gitcommands.go index 14dee6dac..c65841e99 100644 --- a/gitcommands.go +++ b/gitcommands.go @@ -8,12 +8,10 @@ import ( "os" "os/exec" "strings" - "time" "github.com/jesseduffield/gocui" gitconfig "github.com/tcnksm/go-gitconfig" git "gopkg.in/src-d/go-git.v4" - "gopkg.in/src-d/go-git.v4/plumbing/object" ) var ( @@ -418,22 +416,7 @@ func gitCommit(g *gocui.Gui, message string) (string, error) { runSubProcess(g, "git", "commit") return "", nil } - userName, err := gitconfig.Username() - if userName == "" { - return "", errNoUsername - } - userEmail, err := gitconfig.Email() - _, err = w.Commit(message, &git.CommitOptions{ - Author: &object.Signature{ - Name: userName, - Email: userEmail, - When: time.Now(), - }, - }) - if err != nil { - return err.Error(), err - } - return "", nil + return runDirectCommand("git commit -m \"" + message + "\"") } func gitPull() (string, error) {