mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-05-11 12:25:47 +02:00
Fix display of renamed files
This broke with #4346 (Add root node in file tree).
This commit is contained in:
parent
267ef70de6
commit
b0b8ef9cf6
2 changed files with 2 additions and 2 deletions
|
@ -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"),
|
||||
)
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue