mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-07-30 03:23:08 +03:00
Change direct access to Common.UserConfig to a getter
This will allow us to turn the field into an atomic.Value for safe concurrent access.
This commit is contained in:
@ -136,7 +136,7 @@ func (self *WorkingTreeHelper) HandleCommitEditorPress() error {
|
||||
}
|
||||
|
||||
func (self *WorkingTreeHelper) HandleWIPCommitPress() error {
|
||||
skipHookPrefix := self.c.UserConfig.Git.SkipHookPrefix
|
||||
skipHookPrefix := self.c.UserConfig().Git.SkipHookPrefix
|
||||
if skipHookPrefix == "" {
|
||||
return errors.New(self.c.Tr.SkipHookPrefixNotConfigured)
|
||||
}
|
||||
@ -209,7 +209,7 @@ func (self *WorkingTreeHelper) syncRefresh() error {
|
||||
|
||||
func (self *WorkingTreeHelper) prepareFilesForCommit() error {
|
||||
noStagedFiles := !self.AnyStagedFiles()
|
||||
if noStagedFiles && self.c.UserConfig.Gui.SkipNoStagedFilesWarning {
|
||||
if noStagedFiles && self.c.UserConfig().Gui.SkipNoStagedFilesWarning {
|
||||
self.c.LogAction(self.c.Tr.Actions.StageAllFiles)
|
||||
err := self.c.Git().WorkingTree.StageAll()
|
||||
if err != nil {
|
||||
@ -223,10 +223,10 @@ func (self *WorkingTreeHelper) prepareFilesForCommit() error {
|
||||
}
|
||||
|
||||
func (self *WorkingTreeHelper) commitPrefixConfigForRepo() *config.CommitPrefixConfig {
|
||||
cfg, ok := self.c.UserConfig.Git.CommitPrefixes[self.c.Git().RepoPaths.RepoName()]
|
||||
cfg, ok := self.c.UserConfig().Git.CommitPrefixes[self.c.Git().RepoPaths.RepoName()]
|
||||
if ok {
|
||||
return &cfg
|
||||
}
|
||||
|
||||
return self.c.UserConfig.Git.CommitPrefix
|
||||
return self.c.UserConfig().Git.CommitPrefix
|
||||
}
|
||||
|
Reference in New Issue
Block a user