mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-07-30 03:23:08 +03:00
Fix display of renamed files
This broke with #4346 (Add root node in file tree).
This commit is contained in:
@ -308,7 +308,7 @@ func fileNameAtDepth(node *filetree.Node[models.File], depth int) string {
|
||||
name := join(splitName[depth:])
|
||||
|
||||
if node.File != nil && node.File.IsRename() {
|
||||
splitPrevName := split(node.File.PreviousPath)
|
||||
splitPrevName := split("./" + node.File.PreviousPath)
|
||||
|
||||
prevName := node.File.PreviousPath
|
||||
// if the file has just been renamed inside the same directory, we can shave off
|
||||
|
@ -29,7 +29,7 @@ var RenamedFiles = NewIntegrationTest(NewIntegrationTestArgs{
|
||||
Equals("▼ /"),
|
||||
Equals(" ▼ dir"),
|
||||
Equals(" R file1 → file1"),
|
||||
Equals(" R dir/file2 → file2-renamed"), // don't want the 'dir/' prefix here
|
||||
Equals(" R file2 → file2-renamed"),
|
||||
Equals(" R dir/nested/file3 → file3"),
|
||||
)
|
||||
},
|
||||
|
Reference in New Issue
Block a user