1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-06-15 00:15:32 +02:00

improve remove file logic

This commit is contained in:
Jesse Duffield
2018-08-18 20:14:44 +10:00
parent 0174375562
commit 08666889f4
3 changed files with 16 additions and 4 deletions

View File

@ -167,3 +167,10 @@ func (c *OSCommand) Quote(message string) string {
message = strings.Replace(message, "`", "\\`", -1)
return c.Platform.escapedQuote + message + c.Platform.escapedQuote
}
// Unquote removes wrapping quotations marks if they are present
// this is needed for removing quotes from staged filenames with spaces
func (c *OSCommand) Unquote(message string) string {
message = strings.Replace(message, `"`, "", -1)
return message
}