Add enableGhCommand flag

This commit is contained in:
Yuki Osaki 2021-11-01 00:00:39 +09:00
parent 66f3978ab5
commit 2d1c29fa76
3 changed files with 7 additions and 1 deletions

View file

@ -68,6 +68,7 @@ git:
overrideGpg: false # prevents lazygit from spawning a separate process when using GPG
disableForcePushing: false
parseEmoji: false
enableGhCommand: false
os:
editCommand: '' # see 'Configuring File Editing' section
editCommandTemplate: '{{editor}} {{filename}}'

View file

@ -70,6 +70,7 @@ type GitConfig struct {
DisableForcePushing bool `yaml:"disableForcePushing"`
CommitPrefixes map[string]CommitPrefixConfig `yaml:"commitPrefixes"`
ParseEmoji bool `yaml:"parseEmoji"`
EnableGhCommand bool `yaml:"enableGhCommand"`
}
type PagingConfig struct {
@ -345,6 +346,7 @@ func GetDefaultConfig() *UserConfig {
DisableForcePushing: false,
CommitPrefixes: map[string]CommitPrefixConfig(nil),
ParseEmoji: false,
EnableGhCommand: false,
},
Refresher: RefresherConfig{
RefreshInterval: 10,

View file

@ -72,7 +72,10 @@ func (gui *Gui) refreshReflogCommitsConsideringStartup() {
})
go utils.Safe(func() {
// The github cli can be quite slow so we load the github PRs sparately
gui.refreshGithubPullRequests()
if gui.Config.GetUserConfig().Git.EnableGhCommand {
gui.refreshGithubPullRequests()
}
wg.Wait()
_ = gui.postRefreshUpdate(gui.State.Contexts.Branches)
})