mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-05-11 12:25:47 +02: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:
parent
f114321322
commit
f98b57aa5e
70 changed files with 204 additions and 193 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue