From 6f9d234116609e5c7707b8ad9727d6b62ca8e519 Mon Sep 17 00:00:00 2001 From: Stefan Haller Date: Fri, 27 Mar 2026 14:02:47 +0100 Subject: [PATCH] Remove go-git repo from ConfigCommands --- pkg/commands/git.go | 2 +- pkg/commands/git_commands/config.go | 4 ---- pkg/commands/git_commands/deps_test.go | 2 +- 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/pkg/commands/git.go b/pkg/commands/git.go index a5666cfc1..ab0e8d354 100644 --- a/pkg/commands/git.go +++ b/pkg/commands/git.go @@ -110,7 +110,7 @@ func NewGitCommandAux( // and allows for better namespacing when compared to having every method living // on the one struct. // common ones are: cmn, osCommand, dotGitDir, configCommands - configCommands := git_commands.NewConfigCommands(cmn, gitConfig, repo) + configCommands := git_commands.NewConfigCommands(cmn, gitConfig) gitCommon := git_commands.NewGitCommon(cmn, version, cmd, osCommand, repoPaths, repo, configCommands, pagerConfig) diff --git a/pkg/commands/git_commands/config.go b/pkg/commands/git_commands/config.go index d42d060c8..ef463e3f6 100644 --- a/pkg/commands/git_commands/config.go +++ b/pkg/commands/git_commands/config.go @@ -3,7 +3,6 @@ package git_commands import ( "strings" - gogit "github.com/jesseduffield/go-git/v5" "github.com/jesseduffield/lazygit/pkg/commands/git_config" "github.com/jesseduffield/lazygit/pkg/commands/oscommands" "github.com/jesseduffield/lazygit/pkg/common" @@ -19,18 +18,15 @@ type ConfigCommands struct { *common.Common gitConfig git_config.IGitConfig - repo *gogit.Repository } func NewConfigCommands( common *common.Common, gitConfig git_config.IGitConfig, - repo *gogit.Repository, ) *ConfigCommands { return &ConfigCommands{ Common: common, gitConfig: gitConfig, - repo: repo, } } diff --git a/pkg/commands/git_commands/deps_test.go b/pkg/commands/git_commands/deps_test.go index 3c4bd5a14..9af509004 100644 --- a/pkg/commands/git_commands/deps_test.go +++ b/pkg/commands/git_commands/deps_test.go @@ -76,7 +76,7 @@ func buildGitCommon(deps commonDeps) *GitCommon { } gitCommon.repo = buildRepo() - gitCommon.config = NewConfigCommands(gitCommon.Common, gitConfig, gitCommon.repo) + gitCommon.config = NewConfigCommands(gitCommon.Common, gitConfig) getenv := deps.getenv if getenv == nil {