diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2020-10-04 11:00:48 +1100 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2020-10-10 00:23:01 +1100 |
commit | 37bb89dac33cb4236bf817e1e2e09cb1cbfade5c (patch) | |
tree | ea06fa4595a7f2d7eff80c2602648b18450f5988 /pkg/commands/git.go | |
parent | 7d9aa97f9691dd0a8658c4b6626877a198c5d03c (diff) |
type i18n
Diffstat (limited to 'pkg/commands/git.go')
-rw-r--r-- | pkg/commands/git.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/pkg/commands/git.go b/pkg/commands/git.go index af1533886..63b0e6859 100644 --- a/pkg/commands/git.go +++ b/pkg/commands/git.go @@ -30,7 +30,7 @@ type GitCommand struct { Log *logrus.Entry OSCommand *oscommands.OSCommand Repo *gogit.Repository - Tr *i18n.Localizer + Tr *i18n.TranslationSet Config config.AppConfigurer getGlobalGitConfig func(string) (string, error) getLocalGitConfig func(string) (string, error) @@ -44,7 +44,7 @@ type GitCommand struct { } // NewGitCommand it runs git commands -func NewGitCommand(log *logrus.Entry, osCommand *oscommands.OSCommand, tr *i18n.Localizer, config config.AppConfigurer) (*GitCommand, error) { +func NewGitCommand(log *logrus.Entry, osCommand *oscommands.OSCommand, tr *i18n.TranslationSet, config config.AppConfigurer) (*GitCommand, error) { var repo *gogit.Repository // see what our default push behaviour is @@ -64,7 +64,7 @@ func NewGitCommand(log *logrus.Entry, osCommand *oscommands.OSCommand, tr *i18n. return nil, err } - if repo, err = setupRepository(gogit.PlainOpen, tr.SLocalize); err != nil { + if repo, err = setupRepository(gogit.PlainOpen, tr.GitconfigParseErr); err != nil { return nil, err } @@ -140,7 +140,7 @@ func resolvePath(path string) (string, error) { return filepath.EvalSymlinks(path) } -func setupRepository(openGitRepository func(string) (*gogit.Repository, error), sLocalize func(string) string) (*gogit.Repository, error) { +func setupRepository(openGitRepository func(string) (*gogit.Repository, error), gitConfigParseErrorStr string) (*gogit.Repository, error) { unresolvedPath := env.GetGitDirEnv() if unresolvedPath == "" { var err error @@ -159,7 +159,7 @@ func setupRepository(openGitRepository func(string) (*gogit.Repository, error), if err != nil { if strings.Contains(err.Error(), `unquoted '\' must be followed by new line`) { - return nil, errors.New(sLocalize("GitconfigParseErr")) + return nil, errors.New(gitConfigParseErrorStr) } return nil, err |