mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-07-28 16:02:01 +03:00
remove repo field
This commit is contained in:
@ -5,6 +5,8 @@ import (
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
gogit "github.com/jesseduffield/go-git/v5"
|
||||
"github.com/jesseduffield/go-git/v5/config"
|
||||
"github.com/jesseduffield/lazygit/pkg/commands/git_config"
|
||||
"github.com/jesseduffield/lazygit/pkg/common"
|
||||
"github.com/jesseduffield/lazygit/pkg/utils"
|
||||
@ -14,6 +16,7 @@ type ConfigCommands struct {
|
||||
*common.Common
|
||||
|
||||
gitConfig git_config.IGitConfig
|
||||
repo *gogit.Repository
|
||||
}
|
||||
|
||||
func NewConfigCommands(
|
||||
@ -80,3 +83,13 @@ func (self *ConfigCommands) GetShowUntrackedFiles() string {
|
||||
func (self *ConfigCommands) GetPushToCurrent() bool {
|
||||
return self.gitConfig.Get("push.default") == "current"
|
||||
}
|
||||
|
||||
// returns the repo's branches as specified in the git config
|
||||
func (self *ConfigCommands) Branches() (map[string]*config.Branch, error) {
|
||||
conf, err := self.repo.Config()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return conf.Branches, nil
|
||||
}
|
||||
|
@ -22,8 +22,6 @@ import (
|
||||
type GitCommand struct {
|
||||
*common.Common
|
||||
|
||||
Repo *gogit.Repository
|
||||
|
||||
Loaders Loaders
|
||||
|
||||
Cmd oscommands.ICmdObjBuilder
|
||||
@ -123,8 +121,6 @@ func NewGitCommandAux(
|
||||
return &GitCommand{
|
||||
Common: cmn,
|
||||
|
||||
Repo: repo,
|
||||
|
||||
Cmd: cmd,
|
||||
|
||||
Submodule: submoduleCommands,
|
||||
|
Reference in New Issue
Block a user