diff options
Diffstat (limited to 'pkg/commands/git.go')
-rw-r--r-- | pkg/commands/git.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/pkg/commands/git.go b/pkg/commands/git.go index 1b798990c..afd18dee7 100644 --- a/pkg/commands/git.go +++ b/pkg/commands/git.go @@ -910,3 +910,9 @@ func (c *GitCommand) ResetHardHead() error { func (c *GitCommand) ResetSoftHead() error { return c.OSCommand.RunCommand("git reset --soft HEAD") } + +// DiffCommits show diff between commits +func (c *GitCommand) DiffCommits(sha1, sha2 string) (string, error) { + cmd := fmt.Sprintf("git diff --color %s %s", sha1, sha2) + return c.OSCommand.RunCommandWithOutput(cmd) +} |