mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-05-12 12:55:47 +02: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:
parent
357c046df2
commit
f7295a97c0
4 changed files with 74 additions and 3 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue