mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-05-12 12:55:47 +02:00
dont panic when catting directories
This commit is contained in:
parent
320ccdb22a
commit
7e1e97d050
9 changed files with 102 additions and 8 deletions
|
@ -86,16 +86,17 @@ func (c *GitCommand) GetStatusFiles() []File {
|
|||
change := statusString[0:2]
|
||||
stagedChange := change[0:1]
|
||||
unstagedChange := statusString[1:2]
|
||||
filename := statusString[3:]
|
||||
filename := c.OSCommand.Unquote(statusString[3:])
|
||||
tracked := !includes([]string{"??", "A ", "AM"}, change)
|
||||
file := File{
|
||||
Name: c.OSCommand.Unquote(filename),
|
||||
Name: filename,
|
||||
DisplayString: statusString,
|
||||
HasStagedChanges: !includes([]string{" ", "U", "?"}, stagedChange),
|
||||
HasUnstagedChanges: unstagedChange != " ",
|
||||
Tracked: tracked,
|
||||
Deleted: unstagedChange == "D" || stagedChange == "D",
|
||||
HasMergeConflicts: change == "UU",
|
||||
Type: c.OSCommand.FileType(filename),
|
||||
}
|
||||
files = append(files, file)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue