1
0
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:
skanehira
2019-03-09 23:42:10 +09:00
committed by Jesse Duffield
parent 1b6e46973e
commit 06fe726ee7
10 changed files with 174 additions and 13 deletions

View File

@ -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)
}