mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-06-17 00:18:05 +02:00
Add feature of display committed file list #383
This commit is contained in:
committed by
Jesse Duffield
parent
1b6e46973e
commit
06fe726ee7
@ -796,3 +796,15 @@ func (c *GitCommand) CherryPickCommits(commits []*Commit) error {
|
||||
|
||||
return c.OSCommand.RunPreparedCommand(cmd)
|
||||
}
|
||||
|
||||
// CommitFiles get the specified commit files
|
||||
func (c *GitCommand) CommitFiles(commitID string) (string, error) {
|
||||
cmd := fmt.Sprintf("git show --pretty= --name-only %s", commitID)
|
||||
return c.OSCommand.RunCommandWithOutput(cmd)
|
||||
}
|
||||
|
||||
// ShowCommitFile get the diff of specified commit file
|
||||
func (c *GitCommand) ShowCommitFile(commitID, file string) (string, error) {
|
||||
cmd := fmt.Sprintf("git show --color %s -- %s", commitID, file)
|
||||
return c.OSCommand.RunCommandWithOutput(cmd)
|
||||
}
|
||||
|
Reference in New Issue
Block a user