mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-01-12 04:23:03 +02:00
Fix staged renamed file with unstaged changes displays incorrectly in Files view #1408
This commit is contained in:
parent
6c415d1341
commit
a553f7fb77
@ -94,10 +94,11 @@ func (c *GitCommand) GitStatus(opts GitStatusOptions) ([]string, error) {
|
||||
original := splitLines[i]
|
||||
if len(original) < 2 {
|
||||
continue
|
||||
} else if strings.HasPrefix(original, "R ") {
|
||||
} else if strings.HasPrefix(original, "R") {
|
||||
// if a line starts with 'R' then the next line is the original file.
|
||||
next := strings.TrimSpace(splitLines[i+1])
|
||||
original = "R " + next + RENAME_SEPARATOR + strings.TrimPrefix(original, "R ")
|
||||
prefix := original[:3] // /^R. /
|
||||
original = prefix + next + RENAME_SEPARATOR + strings.TrimPrefix(original, prefix)
|
||||
i++
|
||||
}
|
||||
response = append(response, original)
|
||||
|
Loading…
Reference in New Issue
Block a user