mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-06-06 23:46:13 +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]
|
original := splitLines[i]
|
||||||
if len(original) < 2 {
|
if len(original) < 2 {
|
||||||
continue
|
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.
|
// if a line starts with 'R' then the next line is the original file.
|
||||||
next := strings.TrimSpace(splitLines[i+1])
|
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++
|
i++
|
||||||
}
|
}
|
||||||
response = append(response, original)
|
response = append(response, original)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user