mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-06-15 00:15:32 +02:00
allow user to checkout old files
This commit is contained in:
@ -808,3 +808,9 @@ func (c *GitCommand) ShowCommitFile(commitID, file string) (string, error) {
|
||||
cmd := fmt.Sprintf("git show --color %s -- %s", commitID, file)
|
||||
return c.OSCommand.RunCommandWithOutput(cmd)
|
||||
}
|
||||
|
||||
// CheckoutFile checks out the file for the given commit
|
||||
func (c *GitCommand) CheckoutFile(commitSha, fileName string) error {
|
||||
cmd := fmt.Sprintf("git checkout %s %s", commitSha, fileName)
|
||||
return c.OSCommand.RunCommand(cmd)
|
||||
}
|
||||
|
Reference in New Issue
Block a user