mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-04-25 12:24:47 +02:00
revert to using cli git command rather than go-git for committing
This commit is contained in:
parent
35d695fd0c
commit
4cd2d70659
@ -8,12 +8,10 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
|
||||||
|
|
||||||
"github.com/jesseduffield/gocui"
|
"github.com/jesseduffield/gocui"
|
||||||
gitconfig "github.com/tcnksm/go-gitconfig"
|
gitconfig "github.com/tcnksm/go-gitconfig"
|
||||||
git "gopkg.in/src-d/go-git.v4"
|
git "gopkg.in/src-d/go-git.v4"
|
||||||
"gopkg.in/src-d/go-git.v4/plumbing/object"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@ -418,22 +416,7 @@ func gitCommit(g *gocui.Gui, message string) (string, error) {
|
|||||||
runSubProcess(g, "git", "commit")
|
runSubProcess(g, "git", "commit")
|
||||||
return "", nil
|
return "", nil
|
||||||
}
|
}
|
||||||
userName, err := gitconfig.Username()
|
return runDirectCommand("git commit -m \"" + message + "\"")
|
||||||
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
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func gitPull() (string, error) {
|
func gitPull() (string, error) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user