Fix display of renamed files

This broke with #4346 (Add root node in file tree).
This commit is contained in:
Stefan Haller 2025-04-02 17:54:53 +02:00
parent 267ef70de6
commit b0b8ef9cf6
2 changed files with 2 additions and 2 deletions

View file

@ -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

View file

@ -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"),
)
},