summaryrefslogtreecommitdiffstats
path: root/pkg/commands/git.go
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2018-08-12 23:29:58 +1000
committerJesse Duffield <jessedduffield@gmail.com>2018-08-12 23:29:58 +1000
commite6beb5d50b40640fd83b55bc44fa377408de8b05 (patch)
tree9778b94c1c9360c8cbc474ff8203bfd296de348e /pkg/commands/git.go
parente8eb78617c17d8b743fcb17c0790c42e11cd5db5 (diff)
no more go-git for committing (reflecting the change in master)
Diffstat (limited to 'pkg/commands/git.go')
-rw-r--r--pkg/commands/git.go20
1 files changed, 2 insertions, 18 deletions
diff --git a/pkg/commands/git.go b/pkg/commands/git.go
index 5bcf2334e..99ecec720 100644
--- a/pkg/commands/git.go
+++ b/pkg/commands/git.go
@@ -6,14 +6,12 @@ import (
"os"
"os/exec"
"strings"
- "time"
"github.com/Sirupsen/logrus"
"github.com/jesseduffield/gocui"
"github.com/jesseduffield/lazygit/pkg/utils"
gitconfig "github.com/tcnksm/go-gitconfig"
gogit "gopkg.in/src-d/go-git.v4"
- "gopkg.in/src-d/go-git.v4/plumbing/object"
)
// GitCommand is our main git interface
@@ -272,27 +270,13 @@ func (c *GitCommand) AbortMerge() (string, error) {
// GitCommit commit to git
func (c *GitCommand) GitCommit(g *gocui.Gui, message string) (string, error) {
+ command := "git commit -m \"" + message + "\""
gpgsign, _ := gitconfig.Global("commit.gpgsign")
if gpgsign != "" {
sub, err := c.OSCommand.RunSubProcess("git", "commit")
return "", nil
}
- userName, err := gitconfig.Username()
- if userName == "" {
- return "", errNoUsername
- }
- userEmail, err := gitconfig.Email()
- _, err = c.Worktree.Commit(message, &gogit.CommitOptions{
- Author: &object.Signature{
- Name: userName,
- Email: userEmail,
- When: time.Now(),
- },
- })
- if err != nil {
- return err.Error(), err
- }
- return "", nil
+ return c.OSCommand.RunDirectCommand(command)
}
// GitPull pull from repo