1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-30 03:23:08 +03:00

anonymous reporting data

This commit is contained in:
Jesse Duffield
2018-08-26 15:46:18 +10:00
parent 93ab892bdd
commit 540edc0c35
20 changed files with 1256 additions and 42 deletions

View File

@ -7,23 +7,23 @@ import (
"os/exec"
"strings"
"github.com/sirupsen/logrus"
"github.com/jesseduffield/gocui"
"github.com/jesseduffield/lazygit/pkg/utils"
"github.com/sirupsen/logrus"
gitconfig "github.com/tcnksm/go-gitconfig"
gogit "gopkg.in/src-d/go-git.v4"
)
// GitCommand is our main git interface
type GitCommand struct {
Log *logrus.Logger
Log *logrus.Entry
OSCommand *OSCommand
Worktree *gogit.Worktree
Repo *gogit.Repository
}
// NewGitCommand it runs git commands
func NewGitCommand(log *logrus.Logger, osCommand *OSCommand) (*GitCommand, error) {
func NewGitCommand(log *logrus.Entry, osCommand *OSCommand) (*GitCommand, error) {
gitCommand := &GitCommand{
Log: log,
OSCommand: osCommand,

View File

@ -5,14 +5,14 @@ import (
"strings"
"testing"
"github.com/sirupsen/logrus"
"github.com/jesseduffield/lazygit/pkg/test"
"github.com/sirupsen/logrus"
)
func getDummyLog() *logrus.Logger {
func getDummyLog() *logrus.Entry {
log := logrus.New()
log.Out = ioutil.Discard
return log
return log.WithField("test", "test")
}
func getDummyOSCommand() *OSCommand {

View File

@ -25,12 +25,12 @@ type Platform struct {
// OSCommand holds all the os commands
type OSCommand struct {
Log *logrus.Logger
Log *logrus.Entry
Platform *Platform
}
// NewOSCommand os command runner
func NewOSCommand(log *logrus.Logger) (*OSCommand, error) {
func NewOSCommand(log *logrus.Entry) (*OSCommand, error) {
osCommand := &OSCommand{
Log: log,
Platform: getPlatform(),