mirror of
https://github.com/jesseduffield/lazygit.git
synced 2026-11-21 04:46:29 +03:00
Nothing reads it. It's a pointer to the AppConfig's in-memory copy of state.yml, which the following commits replace with fresh reads of the file. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
33 lines
751 B
Go
33 lines
751 B
Go
package common
|
|
|
|
import (
|
|
"github.com/jesseduffield/lazygit/pkg/config"
|
|
"github.com/jesseduffield/lazygit/pkg/i18n"
|
|
"github.com/jesseduffield/lazygit/pkg/utils"
|
|
"github.com/spf13/afero"
|
|
)
|
|
|
|
func NewDummyCommon() *Common {
|
|
tr := i18n.EnglishTranslationSet()
|
|
cmn := &Common{
|
|
Log: utils.NewDummyLog(),
|
|
Tr: tr,
|
|
Fs: afero.NewOsFs(),
|
|
}
|
|
cmn.SetUserConfig(config.GetDefaultConfig())
|
|
return cmn
|
|
}
|
|
|
|
func NewDummyCommonWithUserConfig(userConfig *config.UserConfig) *Common {
|
|
tr := i18n.EnglishTranslationSet()
|
|
cmn := &Common{
|
|
Log: utils.NewDummyLog(),
|
|
Tr: tr,
|
|
// TODO: remove dependency on actual filesystem in tests and switch to using
|
|
// in-memory for everything
|
|
Fs: afero.NewOsFs(),
|
|
}
|
|
cmn.SetUserConfig(userConfig)
|
|
return cmn
|
|
}
|