1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-30 03:23:08 +03:00

Add a root item ("/") if files at top level have changed

This commit is contained in:
Stefan Haller
2025-03-01 07:25:26 +01:00
parent 0b42cfb568
commit 26459523f5
61 changed files with 663 additions and 448 deletions

View File

@ -48,10 +48,11 @@ func TestRenderFileTree(t *testing.T) {
},
showLineChanges: true,
expected: []string{
" M test +1 -1",
" M test2 +1",
" M test3 -1",
" M test4",
"▼ /",
" M test +1 -1",
" M test2 +1",
" M test3 -1",
" M test4",
},
},
{
@ -66,16 +67,17 @@ func TestRenderFileTree(t *testing.T) {
},
expected: toStringSlice(
`
▶ dir1
dir2
▼ /
dir1
▼ dir2
M file3
M file4
M file5
M file1
▼ dir2
M file3
M file4
M file5
M file1
`,
),
collapsedPaths: []string{"dir1"},
collapsedPaths: []string{"./dir1"},
},
}
@ -127,16 +129,17 @@ func TestRenderCommitFileTree(t *testing.T) {
},
expected: toStringSlice(
`
▶ dir1
dir2
▼ /
dir1
▼ dir2
D file3
M file4
M file5
M file1
▼ dir2
D file3
M file4
M file5
M file1
`,
),
collapsedPaths: []string{"dir1"},
collapsedPaths: []string{"./dir1"},
},
}