1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-03-29 22:07:13 +02:00

fix checkout file command

This commit is contained in:
Ryooooooga 2021-08-13 21:49:40 +09:00
parent 488c43aaa2
commit 37700908cc
No known key found for this signature in database
GPG Key ID: 07CF200DFCC20C25

View File

@ -255,7 +255,7 @@ func (c *GitCommand) ShowFileDiffCmdStr(from string, to string, reverse bool, fi
// CheckoutFile checks out the file for the given commit
func (c *GitCommand) CheckoutFile(commitSha, fileName string) error {
return c.RunCommand("git checkout %s %s", commitSha, fileName)
return c.RunCommand("git checkout %s -- %s", commitSha, c.OSCommand.Quote(fileName))
}
// DiscardOldFileChanges discards changes to a file from an old commit