mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-06-23 00:39:13 +02:00
start breaking up git struct
This commit is contained in:
pkg
app
commands
branches.gobranches_test.gocommits.gocommits_test.goconfig.godummies.gofiles.gofiles_test.gogit.go
loaders
oscommands
patch_rebases.gorebasing.gorebasing_test.goremotes.gostash_entries.gostash_entries_test.gostatus.gosubmodules.gosync.gosync_test.gotags.goworking_tree.goworking_tree_test.gogui
branches_panel.gocherry_picking.gocommit_files_panel.gocommit_message_panel.gocommits_panel.godiff_context_size.godiff_context_size_test.godiscard_changes_menu_panel.godummies.gofiles_panel.goglobal_handlers.gogpg.gogui.gokeybindings.golayout.goline_by_line_panel.golist_context_config.gomerge_panel.gomodes.gopatch_building_panel.gopatch_options_panel.gopty.gopull_request_menu_panel.gorebase_options_panel.gorecent_repos_panel.goreflog_panel.goremote_branches_panel.goremotes_panel.goreset_menu_panel.gostaging_panel.gostash_panel.gostatus_panel.gosub_commits_panel.gosubmodules_panel.gotags_panel.goundoing.goworkspace_reset_options_panel.go
i18n
utils
@ -11,19 +11,24 @@ import (
|
||||
"github.com/jesseduffield/lazygit/pkg/utils"
|
||||
)
|
||||
|
||||
type FileLoaderConfig interface {
|
||||
GetShowUntrackedFiles() string
|
||||
}
|
||||
|
||||
type FileLoader struct {
|
||||
*common.Common
|
||||
cmd oscommands.ICmdObjBuilder
|
||||
config FileLoaderConfig
|
||||
gitConfig git_config.IGitConfig
|
||||
getFileType func(string) string
|
||||
}
|
||||
|
||||
func NewFileLoader(cmn *common.Common, cmd oscommands.ICmdObjBuilder, gitConfig git_config.IGitConfig) *FileLoader {
|
||||
func NewFileLoader(cmn *common.Common, cmd oscommands.ICmdObjBuilder, config FileLoaderConfig) *FileLoader {
|
||||
return &FileLoader{
|
||||
Common: cmn,
|
||||
cmd: cmd,
|
||||
gitConfig: gitConfig,
|
||||
getFileType: oscommands.FileType,
|
||||
config: config,
|
||||
}
|
||||
}
|
||||
|
||||
@ -33,7 +38,7 @@ type GetStatusFileOptions struct {
|
||||
|
||||
func (self *FileLoader) GetStatusFiles(opts GetStatusFileOptions) []*models.File {
|
||||
// check if config wants us ignoring untracked files
|
||||
untrackedFilesSetting := self.gitConfig.Get("status.showUntrackedFiles")
|
||||
untrackedFilesSetting := self.config.GetShowUntrackedFiles()
|
||||
|
||||
if untrackedFilesSetting == "" {
|
||||
untrackedFilesSetting = "all"
|
||||
|
Reference in New Issue
Block a user