mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-06-11 12:48:10 +03:00
Add a "Content of selected file" entry to the copy menu for commit files
This is useful for copying the entire content of the selected file as it was at the selected commit. We only add it to the commit files panel; it is not needed in the files panel, because there you can simply press "e" to edit the file.
This commit is contained in:
@ -279,6 +279,13 @@ func (self *CommitCommands) ShowCmdObj(hash string, filterPath string) oscommand
|
||||
return self.cmd.New(cmdArgs).DontLog()
|
||||
}
|
||||
|
||||
func (self *CommitCommands) ShowFileContentCmdObj(hash string, filePath string) oscommands.ICmdObj {
|
||||
cmdArgs := NewGitCmd("show").
|
||||
Arg(fmt.Sprintf("%s:%s", hash, filePath)).
|
||||
ToArgv()
|
||||
return self.cmd.New(cmdArgs).DontLog()
|
||||
}
|
||||
|
||||
// Revert reverts the selected commit by hash
|
||||
func (self *CommitCommands) Revert(hash string) error {
|
||||
cmdArgs := NewGitCmd("revert").Arg(hash).ToArgv()
|
||||
|
Reference in New Issue
Block a user