1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-11-29 22:48:24 +02:00

Hide worktree functionality on old git versions

This commit is contained in:
Jesse Duffield
2023-07-17 13:56:50 +10:00
parent ec839e9e96
commit 3cd2d6fa5c
5 changed files with 46 additions and 26 deletions

View File

@@ -566,25 +566,32 @@ func (gui *Gui) initGocui(headless bool, test integrationTypes.IntegrationTest)
}
func (gui *Gui) viewTabMap() map[string][]context.TabView {
return map[string][]context.TabView{
"branches": {
{
Tab: gui.c.Tr.LocalBranchesTitle,
ViewName: "localBranches",
},
{
Tab: gui.c.Tr.RemotesTitle,
ViewName: "remotes",
},
{
Tab: gui.c.Tr.TagsTitle,
ViewName: "tags",
},
{
branchesTabs := []context.TabView{
{
Tab: gui.c.Tr.LocalBranchesTitle,
ViewName: "localBranches",
},
{
Tab: gui.c.Tr.RemotesTitle,
ViewName: "remotes",
},
{
Tab: gui.c.Tr.TagsTitle,
ViewName: "tags",
},
}
if gui.c.Git().Version.SupportsWorktrees() {
branchesTabs = append(branchesTabs,
context.TabView{
Tab: gui.c.Tr.WorktreesTitle,
ViewName: "worktrees",
},
},
)
}
return map[string][]context.TabView{
"branches": branchesTabs,
"commits": {
{
Tab: gui.c.Tr.CommitsTitle,